Gtk.WidgetClass - Class Structures - Gtk 3.0 (original) (raw)
activate_signal
r
The signal to emit when a widget of this class is activated, Gtk.Widget.activate() handles the emission. Implementation of this signal is optional.
adjust_baseline_allocation
r
adjust_baseline_request
r
adjust_size_allocation
r
Convert an initial size allocation assigned by a Gtk.Container using Gtk.Widget.size_allocate(), into an actual size allocation to be used by the widget. adjust_size_allocation adjusts to a child widget’s actual allocation from what a parent container computed for the child. The adjusted allocation must be entirely within the original allocation. In any custom implementation, chain up to the default Gtk.Widget implementation of this method, which applies the margin and alignment properties of Gtk.Widget. Chain up before performing your own adjustments so your own adjustments remove more allocation after the Gtk.Widget base class has already removed margin and alignment. The natural size passed in should be adjusted in the same way as the allocated size, which allows adjustments to perform alignments or other changes based on natural size.
adjust_size_request
r
Convert an initial size request from a widget’s Gtk.SizeRequestMode virtual method implementations into a size request to be used by parent containers in laying out the widget. adjust_size_request adjusts from a child widget’s original request to what a parent container should use for layout. The for_size argument will be -1 if the request should not be for a particular size in the opposing orientation, i.e. if the request is not height-for-width or width-for-height. If for_size is greater than -1, it is the proposed allocation in the opposing orientation that we need the request for. Implementations of adjust_size_request should chain up to the default implementation, which applies Gtk.Widget’s margin properties and imposes any values from Gtk.Widget.set_size_request(). Chaining up should be last, after your subclass adjusts the request, so Gtk.Widget can apply constraints and add the margin properly.
button_press_event
r
Signal will be emitted when a button (typically from a mouse) is pressed.
button_release_event
r
Signal will be emitted when a button (typically from a mouse) is released.
can_activate_accel
r
Signal allows applications and derived widgets to override the default Gtk.Widget handling for determining whether an accelerator can be activated.
child_notify
r
Signal emitted for each child property that has changed on an object.
composited_changed
r
Signal emitted when the composited status of widgets screen changes. See Gdk.Screen.is_composited().
compute_expand
r
Computes whether a container should give this widget extra space when possible.
configure_event
r
Signal will be emitted when the size, position or stacking of the widget’s window has changed.
damage_event
r
Signal emitted when a redirected window belonging to widget gets drawn into.
delete_event
r
Signal emitted if a user requests that a toplevel window is closed.
destroy
r
Signals that all holders of a reference to the widget should release the reference that they hold.
destroy_event
r
Signal is emitted when a Gdk.Window is destroyed.
direction_changed
r
Signal emitted when the text direction of a widget changes.
dispatch_child_properties_changed
r
Seldomly overidden.
drag_begin
r
Signal emitted on the drag source when a drag is started.
drag_data_delete
r
Signal emitted on the drag source when a drag with the action Gdk.DragAction.MOVE is successfully completed.
drag_data_get
r
Signal emitted on the drag source when the drop site requests the data which is dragged.
drag_data_received
r
Signal emitted on the drop site when the dragged data has been received.
drag_drop
r
Signal emitted on the drop site when the user drops the data onto the widget.
drag_end
r
Signal emitted on the drag source when a drag is finished.
drag_failed
r
Signal emitted on the drag source when a drag has failed.
drag_leave
r
Signal emitted on the drop site when the cursor leaves the widget.
drag_motion
r
signal emitted on the drop site when the user moves the cursor over the widget during a drag.
draw
r
Signal emitted when a widget is supposed to render itself.
enter_notify_event
r
Signal event will be emitted when the pointer enters the widget’s window.
event
r
The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic ::event
signal, another, more specific, signal that matches the type of event delivered (e.g. “key-press-event”) and finally a generic “event-after” signal.
focus
r
focus_in_event
r
Signal emitted when the keyboard focus enters the widget’s window.
focus_out_event
r
Signal emitted when the keyboard focus leaves the widget’s window.
get_accessible
r
Returns the accessible object that describes the widget to an assistive technology.
get_preferred_height
r
This is called by containers to obtain the minimum and natural height of a widget. A widget that does not actually trade any height for width or width for height only has to implement these two virtual methods (Gtk.Widget.do_get_preferred_width() and Gtk.Widget.do_get_preferred_height()).
get_preferred_height_and_baseline_for_width
r
get_preferred_height_for_width
r
This is similar to Gtk.Widget.do_get_preferred_height() except that it is passed a contextual width to request height for. By implementing this virtual method it is possible for a Gtk.Label to tell its parent how much height would be required if the label were to be allocated a said width.
get_preferred_width
r
This is called by containers to obtain the minimum and natural width of a widget. A widget will never be allocated a width less than its minimum and will only ever be allocated a width greater than the natural width once all of the said widget’s siblings have received their natural widths. Furthermore, a widget will only ever be allocated a width greater than its natural width if it was configured to receive extra expand space from its parent container.
get_preferred_width_for_height
r
This is analogous to Gtk.Widget.do_get_preferred_height_for_width() except that it operates in the oposite orientation. It’s rare that a widget actually does Gtk.SizeRequestMode.WIDTH_FOR_HEIGHT requests but this can happen when, for example, a widget or container gets additional columns to compensate for a smaller allocated height.
get_request_mode
r
This allows a widget to tell its parent container whether it prefers to be allocated in Gtk.SizeRequestMode.HEIGHT_FOR_WIDTH or Gtk.SizeRequestMode.WIDTH_FOR_HEIGHT mode. Gtk.SizeRequestMode.HEIGHT_FOR_WIDTH means the widget prefers to have Gtk.Widget.do_get_preferred_width() called and then Gtk.Widget.do_get_preferred_height_for_width(). Gtk.SizeRequestMode.CONSTANT_SIZE disables any height-for-width or width-for-height geometry management for a said widget and is the default return. It’s important to note (as described below) that any widget which trades height-for-width or width-for-height must respond properly to both of the virtual methods Gtk.Widget.do_get_preferred_height_for_width() and Gtk.Widget.do_get_preferred_width_for_height() since it might be queried in either Gtk.SizeRequestMode by its parent container.
grab_broken_event
r
Signal emitted when a pointer or keyboard grab on a window belonging to widget gets broken.
grab_focus
r
Causes widget to have the keyboard focus for the Gtk.Window it’s inside.
grab_notify
r
Signal emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.
hide
r
Signal emitted when widget is hidden.
hierarchy_changed
r
Signal emitted when the anchored state of a widget changes.
key_press_event
r
Signal emitted when a key is pressed.
key_release_event
r
Signal is emitted when a key is released.
keynav_failed
r
Signal emitted if keyboard navigation fails.
leave_notify_event
r
Will be emitted when the pointer leaves the widget’s window.
map
r
Signal emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with Gtk.Widget.set_visible()) and all its parents up to the toplevel widget are also visible.
map_event
r
Signal emitted when the widget’s window is mapped.
mnemonic_activate
r
Activates the widget if group_cycling is False, and just grabs the focus if group_cycling is True.
motion_notify_event
r
Signal emitted when the pointer moves over the widget’s Gdk.Window.
move_focus
r
Signal emitted when a change of focus is requested
parent_class
r
The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a Gtk.WidgetClass pointer to be cast to a GObject.ObjectClass pointer.
parent_set
r
Signal emitted when a new parent has been set on a widget.
popup_menu
r
Signal emitted whenever a widget should pop up a context menu.
property_notify_event
r
Signal will be emitted when a property on the widget’s window has been changed or deleted.
proximity_in_event
r
proximity_out_event
r
query_tooltip
r
Signal emitted when “has-tooltip” is True and the hover timeout has expired with the cursor hovering “above” widget; or emitted when widget got focus in keyboard mode.
queue_draw_region
r
Invalidates the area of widget defined by region by calling Gdk.Window.invalidate_region() on the widget’s window and all its child windows.
realize
r
Signal emitted when widget is associated with a Gdk.Window, which means that Gtk.Widget.realize() has been called or the widget has been mapped (that is, it is going to be drawn).
screen_changed
r
Signal emitted when the screen of a widget has changed.
scroll_event
r
Signal emitted when a button in the 4 to 7 range is pressed.
selection_clear_event
r
Signal will be emitted when the the widget’s window has lost ownership of a selection.
selection_get
r
selection_notify_event
r
selection_received
r
selection_request_event
r
Signal will be emitted when another client requests ownership of the selection owned by the widget’s window.
show
r
Signal emitted when widget is shown
show_all
r
Recursively shows a widget, and any child widgets (if the widget is a container).
show_help
r
size_allocate
r
Signal emitted to get the widget allocation.
state_changed
r
Signal emitted when the widget state changes. Deprecated: 3.0
state_flags_changed
r
Signal emitted when the widget state changes, see Gtk.Widget.get_state_flags().
style_set
r
Signal emitted when a new style has been set on a widget. Deprecated: 3.0
style_updated
r
Signal emitted when the Gtk.StyleContext of a widget is changed.
touch_event
r
Signal emitted when a touch event happens
unmap
r
Signal emitted when widget is going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden.
unmap_event
r
Signal will be emitted when the widget’s window is unmapped.
unrealize
r
Signal emitted when the Gdk.Window associated with widget is destroyed, which means that Gtk.Widget.unrealize() has been called or the widget has been unmapped (that is, it is going to be hidden).
visibility_notify_event
r
Signal emitted when the widget’s window is obscured or unobscured.
window_state_event
r
Signal emitted when the state of the toplevel window associated to the widget changes.