Next:
Gtk2::Window
Previous:
Gtk2::VSeparator
 [Gtk2-Perl - Table of Contents][Gtk2-Perl - Index]

Gtk2::Widget



NAME

Gtk2::Widget

HIERARCHY

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget

INTERFACES

  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable

CONSTANTS

EVENT_STOP and EVENT_PROPAGATE are designed for the return from widget event signal handlers and similar, being true to stop or false to propagate. The names can help you avoid confusion over which way is true and which is false. (You can also remember the return as meaning "handled", which is the jargon in a few other signal handler types.)

    Gtk2::EVENT_STOP         # true
    Gtk2::EVENT_PROPAGATE    # false

METHODS

$widget->set_accel_path ($accel_path, $accel_group)

object = $widget->get_accessible

action or undef = $widget->get_action

Since: gtk+ 2.10

boolean = $widget->activate

This function works by emitting an action signal nominated by the various widget subclasses. The signal is normally called activate, but it doesn't have to be.

Currently if you make a widget subclass in Perl there's no way to nominate a signal to be emitted by $widget->activate. A signal merely named activate is not automatically hooked up.

$widget->add_accelerator ($accel_signal, $accel_group, $accel_key, $accel_mods, $flags)

$widget->add_events ($events)

$widget->add_mnemonic_label ($label)

Since: gtk+ 2.4

rectangle = $widget->allocation

Return the current allocated size and position of $widget within its parent widget. The allocated size is not necessarily the same as the requested size.

The returned rect object points into $widget and can only be used as long as $widget exists.

widget or undef = $widget->get_ancestor ($ancestor_package)

$widget->app_paintable ($boolean)

boolean = $widget->app_paintable

$widget->set_app_paintable ($app_paintable)

boolean = $widget->can_activate_accel ($signal_id)

Since: gtk+ 2.4

$widget->can_default ($boolean)

boolean = $widget->can_default

$widget->can_focus ($boolean)

boolean = $widget->can_focus

boolean = $widget->child_focus ($direction)

$widget->child_notify ($child_property)

requisition = $widget->get_child_requisition

This function is only for use in widget implementations. Obtains $widget->requisition, unless someone has forced a particular geometry on the widget (e.g., with set_usize(), in which case it returns that geometry instead of the widget's requisition.

This function differs from size_request() in that it retrieves the last size request value from $widget->requisition, while size_request() actually calls the size_request virtual method (that is, emits the "size-request" signal) on the $widget to compute the size request and fill in $widget->requisition, and only then returns $widget->requisition.

Because this function does not call the size_request method, it can only be used when you know that $widget->requisition is up-to-date. In general, only container implementations have this information; applications should use size_request ().

boolean = $widget->get_child_visible

$widget->set_child_visible ($is_visible)

(path, path_reversed) = $widget->class_path

clipboard = $widget->get_clipboard ($selection=GDK_SELECTION_CLIPBOARD)

Since: gtk+ 2.2

colormap = $widget->get_colormap

$widget->set_colormap ($colormap)

$widget->composite_child ($boolean)

boolean = $widget->composite_child

string = $widget->get_composite_name

$widget->set_composite_name ($name)

context = $widget->create_pango_context

layout = $widget->create_pango_layout ($text)

colormap = Gtk2::Widget->get_default_colormap

colormap = $widget->get_default_colormap

Gtk2::Widget->set_default_colormap ($colormap)

$widget->set_default_colormap ($colormap)

textdirection = Gtk2::Widget->get_default_direction

Gtk2::Widget->set_default_direction ($dir)

style = Gtk2::Widget->get_default_style

style = $widget->get_default_style

visual = Gtk2::Widget->get_default_visual

visual = $widget->get_default_visual

$widget->destroy

textdirection = $widget->get_direction

$widget->set_direction ($dir)

display = $widget->get_display

Since: gtk+ 2.2

$widget->double_buffered ($boolean)

boolean = $widget->double_buffered

$widget->set_double_buffered ($double_buffered)

dragcontext = $widget->drag_begin ($targets, $actions, $button, $event)

boolean = $widget->drag_check_threshold ($start_x, $start_y, $current_x, $current_y)

$widget->drag_dest_add_image_targets

Since: gtk+ 2.6

$widget->drag_dest_add_text_targets

Since: gtk+ 2.6

$widget->drag_dest_add_uri_targets

Since: gtk+ 2.6

atom = $widget->drag_dest_find_target ($context, $target_list)

targetlist or undef = $widget->drag_dest_get_target_list

boolean = $widget->drag_dest_get_track_motion

Since: gtk+ 2.10

$widget->drag_dest_set ($flags, $actions, ...)

$widget->drag_dest_set_proxy ($proxy_window, $protocol, $use_coordinates)

$widget->drag_dest_set_target_list ($target_list)

$widget->drag_dest_set_track_motion ($track_motion)

Since: gtk+ 2.10

$widget->drag_dest_unset

$widget->drag_get_data ($context, $target, $time_)

$widget->drag_highlight

$widget->drag_source_add_image_targets

Since: gtk+ 2.6

$widget->drag_source_add_text_targets

Since: gtk+ 2.6

$widget->drag_source_add_uri_targets

Since: gtk+ 2.6

targetlist or undef = $widget->drag_source_get_target_list

Since: gtk+ 2.4

$widget->drag_source_set ($start_button_mask, $actions, ...)

$widget->drag_source_set_icon ($colormap, $pixmap, $mask)

$widget->drag_source_set_icon_name ($icon_name)

Since: gtk+ 2.8

$widget->drag_source_set_icon_pixbuf ($pixbuf)

$widget->drag_source_set_icon_stock ($stock_id)

$widget->drag_source_set_target_list ($target_list)

Since: gtk+ 2.4

$widget->drag_source_unset

$widget->drag_unhighlight

$widget->drawable ($boolean)

boolean = $widget->drawable

$widget->ensure_style

$widget->error_bell

Since: gtk+ 2.12

boolean = $widget->event ($event)

This rarely-used function emits an event signal on $widget. Don't use this to synthesize events; use Gtk2->main_do_event instead. Don't synthesize expose events; use $gdkwindow->invalidate_rect instead. Basically, the main use for this in gtk2-perl will be to pass motion notify events to rulers from other widgets.

eventmask = $widget->get_events

$widget->set_events ($events)

extensionmode = $widget->get_extension_events

$widget->set_extension_events ($mode)

widgetflags = $widget->flags

widgetflags = $widget->get_flags

$widget->set_flags ($flags)

$widget->freeze_child_notify

$widget->grab_default

$widget->grab_focus

$widget->has_default ($boolean)

boolean = $widget->has_default

$widget->has_focus ($boolean)

boolean = $widget->has_focus

$widget->has_grab ($boolean)

boolean = $widget->has_grab

boolean = $widget->has_screen

Since: gtk+ 2.2

boolean = $widget->get_has_tooltip

Since: gtk+ 2.12

$widget->set_has_tooltip ($has_tooltip)

Since: gtk+ 2.12

$widget->hide

$widget->hide_all

boolean = Gtk2::Widget::hide_on_delete ($widget, ...)

This is a helper function intended to be used as the callback for the delete-event signal:

  $wiget->signal_connect (
    delete_event => \&Gtk2::Widget::hide_on_delete);

$widget->input_shape_combine_mask ($shape_mask, $offset_x, $offset_y)

Since: gtk+ 2.10

rectangle = $widget->intersect ($area)

Returns undef if $widget and $area do not intersect.

boolean = $widget->is_ancestor ($ancestor)

boolean = $widget->is_focus

$widget->is_sensitive ($boolean)

boolean = $widget->is_sensitive

boolean = $widget->keynav_failed ($direction)

Since: gtk+ 2.12

list = $widget->list_mnemonic_labels

Since: gtk+ 2.4

$widget->map

$widget->mapped ($boolean)

boolean = $widget->mapped

boolean = $widget->mnemonic_activate ($group_cycling)

rcstyle = $widget->get_modifier_style

$widget->modify_base ($state, $color)

$widget->modify_bg ($state, $color)

$widget->modify_cursor ($primary, $secondary)

Since: gtk+ 2.12

$widget->modify_fg ($state, $color)

$widget->modify_font ($font_desc)

$widget->modify_style ($style)

$widget->modify_text ($state, $color)

string = $widget->get_name

$widget->set_name ($name)

boolean = $widget->get_no_show_all

Since: gtk+ 2.4

$widget->set_no_show_all ($no_show_all)

Since: gtk+ 2.4

$widget->no_window ($boolean)

boolean = $widget->no_window

context = $widget->get_pango_context

widget or undef = $widget->parent

widget or undef = $widget->get_parent

$widget->parent_sensitive ($boolean)

boolean = $widget->parent_sensitive

$widget->set_parent ($parent)

window = $widget->get_parent_window

$widget->set_parent_window ($parent_window)

(path, path_reversed) = $widget->path

(x, y) = $widget->get_pointer

Gtk2::Widget->pop_colormap (cmap)

$widget->pop_colormap (cmap)

Gtk2::Widget->pop_composite_child

$widget->pop_composite_child

$widget->propagate_event ($event)

From gtk+'s API documentation:

You most likely don't want to use any of these functions; synthesizing events is rarely needed. Consider asking on the mailing list for better ways to achieve your goals. For example, use Gtk2::Gdk::invalidate_rect or Gtk2::Widget::queue_draw instead of making up expose events.

Gtk2::Widget->push_colormap (cmap)

$widget->push_colormap (cmap)

Gtk2::Widget->push_composite_child

$widget->push_composite_child

$widget->queue_draw

$widget->queue_draw_area ($x, $y, $width, $height)

$widget->queue_resize

$widget->queue_resize_no_redraw

Since: gtk+ 2.4

$widget->rc_style ($boolean)

boolean = $widget->rc_style

$widget->realize

$widget->realized ($boolean)

boolean = $widget->realized

$widget->receives_default ($boolean)

boolean = $widget->receives_default

$widget->set_redraw_on_allocate ($redraw_on_allocate)

region = $widget->region_intersect ($region)

boolean = $widget->remove_accelerator ($accel_group, $accel_key, $accel_mods)

$widget->remove_mnemonic_label ($label)

Since: gtk+ 2.4

pixbuf = $widget->render_icon ($stock_id, $size, $detail=undef)

$widget->reparent ($new_parent)

requisition = $widget->requisition

Return the currently desired width and height of $widget. Basically this is the result from the last size_request call on $widget, and therefore may not be up-to-date if $widget has asked for a resize but its container parent has not yet called size_request.

The returned requisition object points into $widget and can only be used as long as $widget exists.

$widget->reset_rc_styles

$widget->reset_shapes

window = $widget->get_root_window

Since: gtk+ 2.2

statetype = $widget->saved_state

screen = $widget->get_screen

Since: gtk+ 2.2

boolean = $widget->set_scroll_adjustments ($hadjustment, $vadjustment)

This function works by emitting a setter signal nominated by the various widget types which have "native" scrolling. The signal is normally called set-scroll-adjustments, but it doesn't have to be.

If you make a widget subclass in Perl and create a signal in it called set-scroll-adjustments taking two Gtk2::Adjustment parameters then the subclassing automatically hooks that up to be emitted by $widget->set_scroll_adjustments. (Your "class closure" default handler code should then store the adjustment objects somewhere.)

$widget->selection_add_target ($selection, $target, $info)

$widget->selection_add_targets ($selection, ...)

$widget->selection_clear_targets ($selection)

boolean = $widget->selection_convert ($selection, $target, $time_)

$widget->selection_remove_all

$widget->sensitive ($boolean)

boolean = $widget->sensitive

$widget->set_sensitive ($sensitive)

settings = $widget->get_settings

$widget->shape_combine_mask ($shape_mask, $offset_x, $offset_y)

$widget->show

$widget->show_all

$widget->show_now

$widget->size_allocate ($allocation)

requisition = $widget->size_request

This function is typically used when implementing a GtkContainer subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with size_allocate ().

You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.

Also remember that the size request is not necessarily the size a widget will actually be allocated.

See also get_child_requisition ()

(width, height) = $widget->get_size_request

Gets the size request that was explicitly set for the widget using set_size_request(). A value of -1 for width or height indicates that the dimension has not been explicitly set and the natural requisition of the widget will be used instead. See set_size_request(). To get the size a widget will actually use, call size_request() instead of this function.

$widget->set_size_request ($width=-1, $height=-1)

statetype = $widget->state

$widget->set_state ($state)

style = $widget->style

style = $widget->get_style

list = $widget->style_get ($first_property_name, ...)

Returns the values of the requested style properties.

Since: gtk+ 2.2

list = $widget->style_get_property ($first_property_name, ...)

An alias for style_get.

Since: gtk+ 2.2

$widget->set_style ($style)

$widget->thaw_child_notify

string = $widget->get_tooltip_markup

Since: gtk+ 2.12

$widget->set_tooltip_markup ($markup)

Since: gtk+ 2.12

string = $widget->get_tooltip_text

Since: gtk+ 2.12

$widget->set_tooltip_text ($text)

Since: gtk+ 2.12

window or undef = $widget->get_tooltip_window

Since: gtk+ 2.12

$widget->set_tooltip_window ($custom_window)

Since: gtk+ 2.12

$widget->toplevel ($value)

boolean = $widget->toplevel

widget or undef = $widget->get_toplevel

(dst_x, dst_y) = $src_widget->translate_coordinates ($dest_widget, $src_x, $src_y)

Returns an empty list if either widget is not realized or if they do not share a common ancestor.

$widget->trigger_tooltip_query

Since: gtk+ 2.12

$widget->unmap

$widget->unparent

$widget->unrealize

$widget->unset_flags ($flags)

$widget->visible ($boolean)

boolean = $widget->visible

visual = $widget->get_visual

window or undef = $widget->window ($new=undef)

PROPERTIES

'app-paintable' (boolean : readable / writable / private)
Whether the application will paint directly on the widget
'can-default' (boolean : readable / writable / private)
Whether the widget can be the default widget
'can-focus' (boolean : readable / writable / private)
Whether the widget can accept the input focus
'composite-child' (boolean : readable / private)
Whether the widget is part of a composite widget
'events' (Gtk2::Gdk::EventMask : readable / writable / private)
The event mask that decides what kind of GdkEvents this widget gets
'extension-events' (Gtk2::Gdk::ExtensionMode : readable / writable / private)
The mask that decides what kind of extension events this widget gets
'has-default' (boolean : readable / writable / private)
Whether the widget is the default widget
'has-focus' (boolean : readable / writable / private)
Whether the widget has the input focus
'has-tooltip' (boolean : readable / writable / private)
Whether this widget has a tooltip
'height-request' (integer : readable / writable / private)
Override for height request of the widget, or -1 if natural request should be used
'is-focus' (boolean : readable / writable / private)
Whether the widget is the focus widget within the toplevel
'name' (string : readable / writable / private)
The name of the widget
'no-show-all' (boolean : readable / writable / private)
Whether gtk_widget_show_all() should not affect this widget
'parent' (Gtk2::Container : readable / writable / private)
The parent widget of this widget. Must be a Container widget
'receives-default' (boolean : readable / writable / private)
If TRUE, the widget will receive the default action when it is focused
'sensitive' (boolean : readable / writable / private)
Whether the widget responds to input
'style' (Gtk2::Style : readable / writable / private)
The style of the widget, which contains information about how it will look (colors etc)
'tooltip-markup' (string : readable / writable / private)
The contents of the tooltip for this widget
'tooltip-text' (string : readable / writable / private)
The contents of the tooltip for this widget
'visible' (boolean : readable / writable / private)
Whether the widget is visible
'width-request' (integer : readable / writable / private)
Override for width request of the widget, or -1 if natural request should be used

SIGNALS

show (Gtk2::Widget)
hide (Gtk2::Widget)
map (Gtk2::Widget)
unmap (Gtk2::Widget)
realize (Gtk2::Widget)
unrealize (Gtk2::Widget)
size-request (Gtk2::Widget, Gtk2::Requisition)
size-allocate (Gtk2::Widget, Gtk2::Gdk::Rectangle)
state-changed (Gtk2::Widget, Gtk2::StateType)
parent-set (Gtk2::Widget, Gtk2::Widget)
hierarchy-changed (Gtk2::Widget, Gtk2::Widget)
style-set (Gtk2::Widget, Gtk2::Style)
direction-changed (Gtk2::Widget, Gtk2::TextDirection)
grab-notify (Gtk2::Widget, boolean)
child-notify (Gtk2::Widget, Glib::ParamSpec)
boolean = mnemonic-activate (Gtk2::Widget, boolean)
grab-focus (Gtk2::Widget)
boolean = focus (Gtk2::Widget, Gtk2::DirectionType)
move-focus (Gtk2::Widget, Gtk2::DirectionType)
boolean = event (Gtk2::Widget, Gtk2::Gdk::Event)
event-after (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = button-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = button-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = scroll-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = motion-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
composited-changed (Gtk2::Widget)
boolean = keynav-failed (Gtk2::Widget, Gtk2::DirectionType)
boolean = delete-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = destroy-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = key-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = key-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = enter-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = leave-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = configure-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = focus-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = focus-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = map-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = unmap-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = property-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = selection-clear-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = selection-request-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = selection-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
selection-received (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt)
selection-get (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt, Glib::UInt)
boolean = proximity-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = proximity-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
drag-leave (Gtk2::Widget, Gtk2::Gdk::DragContext, Glib::UInt)
drag-begin (Gtk2::Widget, Gtk2::Gdk::DragContext)
drag-end (Gtk2::Widget, Gtk2::Gdk::DragContext)
drag-data-delete (Gtk2::Widget, Gtk2::Gdk::DragContext)
boolean = drag-failed (Gtk2::Widget, Gtk2::Gdk::DragContext, GtkDragResult)
boolean = drag-motion (Gtk2::Widget, Gtk2::Gdk::DragContext, integer, integer, Glib::UInt)
boolean = drag-drop (Gtk2::Widget, Gtk2::Gdk::DragContext, integer, integer, Glib::UInt)
drag-data-get (Gtk2::Widget, Gtk2::Gdk::DragContext, Gtk2::SelectionData, Glib::UInt, Glib::UInt)
drag-data-received (Gtk2::Widget, Gtk2::Gdk::DragContext, integer, integer, Gtk2::SelectionData, Glib::UInt, Glib::UInt)
boolean = visibility-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = client-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = no-expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = window-state-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = grab-broken-event (Gtk2::Widget, Gtk2::Gdk::Event)
boolean = query-tooltip (Gtk2::Widget, integer, integer, boolean, Gtk2::Tooltip)
boolean = popup-menu (Gtk2::Widget)
boolean = show-help (Gtk2::Widget, Gtk2::WidgetHelpType)
accel-closures-changed (Gtk2::Widget)
screen-changed (Gtk2::Widget, Gtk2::Gdk::Screen)
boolean = can-activate-accel (Gtk2::Widget, Glib::UInt)

ENUMS AND FLAGS

flags Gtk2::AccelFlags

flags Gtk2::DestDefaults

enum Gtk2::DirectionType

flags Gtk2::Gdk::DragAction

enum Gtk2::Gdk::DragProtocol

flags Gtk2::Gdk::EventMask

enum Gtk2::Gdk::ExtensionMode

flags Gtk2::Gdk::ModifierType

enum Gtk2::IconSize

enum Gtk2::StateType

enum Gtk2::TextDirection

flags Gtk2::WidgetFlags

enum Gtk2::WidgetHelpType

enum GtkDragResult

SEE ALSO

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::TargetEntry

COPYRIGHT

Copyright (C) 2003-2008 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


[Top] Generated by Marek::Pod::HTML 0.49 on Wed Dec 16 23:04:42 2009