Next: Gtk2::Window | Previous: Gtk2::VSeparator | [Gtk2-Perl - Table of Contents] | [Gtk2-Perl - Index] |
Gtk2::Widget
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable
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
Since: gtk+ 2.10
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.
$accel_signal (string)
$accel_group (Gtk2::AccelGroup)
$accel_key (integer)
$accel_mods (Gtk2::Gdk::ModifierType)
$flags (Gtk2::AccelFlags)
Since: gtk+ 2.4
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.
Since: gtk+ 2.4
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 ()
.
Since: gtk+ 2.2
Since: gtk+ 2.2
$targets (Gtk2::TargetList)
$actions (Gtk2::Gdk::DragAction)
$button (integer)
$event (Gtk2::Gdk::Event)
Since: gtk+ 2.6
Since: gtk+ 2.6
Since: gtk+ 2.6
Since: gtk+ 2.10
Since: gtk+ 2.10
Since: gtk+ 2.6
Since: gtk+ 2.6
Since: gtk+ 2.6
Since: gtk+ 2.4
$start_button_mask (Gtk2::Gdk::ModifierType)
$actions (Gtk2::Gdk::DragAction)
... (list) of Gtk2::TargetEntry's
$colormap (Gtk2::Gdk::Colormap or undef)
$pixmap (Gtk2::Gdk::Pixmap or undef)
$mask (Gtk2::Gdk::Bitmap or undef)
Since: gtk+ 2.8
Since: gtk+ 2.4
Since: gtk+ 2.12
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.
Since: gtk+ 2.2
Since: gtk+ 2.12
Since: gtk+ 2.12
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);
Since: gtk+ 2.10
Returns undef if $widget and $area do not intersect.
Since: gtk+ 2.12
Since: gtk+ 2.4
Since: gtk+ 2.12
Since: gtk+ 2.4
Since: gtk+ 2.4
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.
Since: gtk+ 2.4
Since: gtk+ 2.4
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.
Since: gtk+ 2.2
Since: gtk+ 2.2
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.)
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 ()
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.
Returns the values of the requested style properties.
Since: gtk+ 2.2
An alias for style_get.
Since: gtk+ 2.2
Since: gtk+ 2.12
Since: gtk+ 2.12
Since: gtk+ 2.12
Since: gtk+ 2.12
Since: gtk+ 2.12
Since: gtk+ 2.12
Returns an empty list if either widget is not realized or if they do not share a common ancestor.
Since: gtk+ 2.12
'motion' / 'GTK_DEST_DEFAULT_MOTION'
'highlight' / 'GTK_DEST_DEFAULT_HIGHLIGHT'
'drop' / 'GTK_DEST_DEFAULT_DROP'
'all' / 'GTK_DEST_DEFAULT_ALL'
'tab-forward' / 'GTK_DIR_TAB_FORWARD'
'tab-backward' / 'GTK_DIR_TAB_BACKWARD'
'up' / 'GTK_DIR_UP'
'down' / 'GTK_DIR_DOWN'
'left' / 'GTK_DIR_LEFT'
'right' / 'GTK_DIR_RIGHT'
'default' / 'GDK_ACTION_DEFAULT'
'copy' / 'GDK_ACTION_COPY'
'move' / 'GDK_ACTION_MOVE'
'link' / 'GDK_ACTION_LINK'
'private' / 'GDK_ACTION_PRIVATE'
'ask' / 'GDK_ACTION_ASK'
'motif' / 'GDK_DRAG_PROTO_MOTIF'
'xdnd' / 'GDK_DRAG_PROTO_XDND'
'rootwin' / 'GDK_DRAG_PROTO_ROOTWIN'
'none' / 'GDK_DRAG_PROTO_NONE'
'win32-dropfiles' / 'GDK_DRAG_PROTO_WIN32_DROPFILES'
'ole2' / 'GDK_DRAG_PROTO_OLE2'
'local' / 'GDK_DRAG_PROTO_LOCAL'
'exposure-mask' / 'GDK_EXPOSURE_MASK'
'pointer-motion-mask' / 'GDK_POINTER_MOTION_MASK'
'pointer-motion-hint-mask' / 'GDK_POINTER_MOTION_HINT_MASK'
'button-motion-mask' / 'GDK_BUTTON_MOTION_MASK'
'button1-motion-mask' / 'GDK_BUTTON1_MOTION_MASK'
'button2-motion-mask' / 'GDK_BUTTON2_MOTION_MASK'
'button3-motion-mask' / 'GDK_BUTTON3_MOTION_MASK'
'button-press-mask' / 'GDK_BUTTON_PRESS_MASK'
'button-release-mask' / 'GDK_BUTTON_RELEASE_MASK'
'key-press-mask' / 'GDK_KEY_PRESS_MASK'
'key-release-mask' / 'GDK_KEY_RELEASE_MASK'
'enter-notify-mask' / 'GDK_ENTER_NOTIFY_MASK'
'leave-notify-mask' / 'GDK_LEAVE_NOTIFY_MASK'
'focus-change-mask' / 'GDK_FOCUS_CHANGE_MASK'
'structure-mask' / 'GDK_STRUCTURE_MASK'
'property-change-mask' / 'GDK_PROPERTY_CHANGE_MASK'
'visibility-notify-mask' / 'GDK_VISIBILITY_NOTIFY_MASK'
'proximity-in-mask' / 'GDK_PROXIMITY_IN_MASK'
'proximity-out-mask' / 'GDK_PROXIMITY_OUT_MASK'
'substructure-mask' / 'GDK_SUBSTRUCTURE_MASK'
'scroll-mask' / 'GDK_SCROLL_MASK'
'all-events-mask' / 'GDK_ALL_EVENTS_MASK'
'none' / 'GDK_EXTENSION_EVENTS_NONE'
'all' / 'GDK_EXTENSION_EVENTS_ALL'
'cursor' / 'GDK_EXTENSION_EVENTS_CURSOR'
'shift-mask' / 'GDK_SHIFT_MASK'
'lock-mask' / 'GDK_LOCK_MASK'
'control-mask' / 'GDK_CONTROL_MASK'
'mod1-mask' / 'GDK_MOD1_MASK'
'mod2-mask' / 'GDK_MOD2_MASK'
'mod3-mask' / 'GDK_MOD3_MASK'
'mod4-mask' / 'GDK_MOD4_MASK'
'mod5-mask' / 'GDK_MOD5_MASK'
'button1-mask' / 'GDK_BUTTON1_MASK'
'button2-mask' / 'GDK_BUTTON2_MASK'
'button3-mask' / 'GDK_BUTTON3_MASK'
'button4-mask' / 'GDK_BUTTON4_MASK'
'button5-mask' / 'GDK_BUTTON5_MASK'
'super-mask' / 'GDK_SUPER_MASK'
'hyper-mask' / 'GDK_HYPER_MASK'
'meta-mask' / 'GDK_META_MASK'
'release-mask' / 'GDK_RELEASE_MASK'
'modifier-mask' / 'GDK_MODIFIER_MASK'
'invalid' / 'GTK_ICON_SIZE_INVALID'
'menu' / 'GTK_ICON_SIZE_MENU'
'small-toolbar' / 'GTK_ICON_SIZE_SMALL_TOOLBAR'
'large-toolbar' / 'GTK_ICON_SIZE_LARGE_TOOLBAR'
'button' / 'GTK_ICON_SIZE_BUTTON'
'dnd' / 'GTK_ICON_SIZE_DND'
'dialog' / 'GTK_ICON_SIZE_DIALOG'
'normal' / 'GTK_STATE_NORMAL'
'active' / 'GTK_STATE_ACTIVE'
'prelight' / 'GTK_STATE_PRELIGHT'
'selected' / 'GTK_STATE_SELECTED'
'insensitive' / 'GTK_STATE_INSENSITIVE'
'toplevel' / 'GTK_TOPLEVEL'
'no-window' / 'GTK_NO_WINDOW'
'realized' / 'GTK_REALIZED'
'mapped' / 'GTK_MAPPED'
'visible' / 'GTK_VISIBLE'
'sensitive' / 'GTK_SENSITIVE'
'parent-sensitive' / 'GTK_PARENT_SENSITIVE'
'can-focus' / 'GTK_CAN_FOCUS'
'has-focus' / 'GTK_HAS_FOCUS'
'can-default' / 'GTK_CAN_DEFAULT'
'has-default' / 'GTK_HAS_DEFAULT'
'has-grab' / 'GTK_HAS_GRAB'
'rc-style' / 'GTK_RC_STYLE'
'composite-child' / 'GTK_COMPOSITE_CHILD'
'no-reparent' / 'GTK_NO_REPARENT'
'app-paintable' / 'GTK_APP_PAINTABLE'
'receives-default' / 'GTK_RECEIVES_DEFAULT'
'double-buffered' / 'GTK_DOUBLE_BUFFERED'
'no-show-all' / 'GTK_NO_SHOW_ALL'
'success' / 'GTK_DRAG_RESULT_SUCCESS'
'no-target' / 'GTK_DRAG_RESULT_NO_TARGET'
'user-cancelled' / 'GTK_DRAG_RESULT_USER_CANCELLED'
'timeout-expired' / 'GTK_DRAG_RESULT_TIMEOUT_EXPIRED'
'grab-broken' / 'GTK_DRAG_RESULT_GRAB_BROKEN'
'error' / 'GTK_DRAG_RESULT_ERROR'
Copyright (C) 2003-2008 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.