parent-classThe 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 GtkWidgetClass pointer to be cast to a GObjectClass pointer.
showSignal emitted when widget is shown
hideSignal emitted when widget is hidden.
mapSignal emitted when widget is going to be mapped, that is when the
widget is visible (which is controlled with widget:set-visible) and all its parents up to the
toplevel widget are also visible.
unmapSignal 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.
realizeSignal emitted when widget is associated with a
<GdkSurface>, which means that
widget:realize has been called or the
widget has been mapped (that is, it is going to be drawn).
unrealizeSignal emitted when the GdkSurface associated with widget is destroyed,
which means that widget:unrealize has
been called or the widget has been unmapped (that is, it is going to be
hidden).
rootCalled when the widget gets added to a <GtkRoot>
widget. Must chain up
unrootCalled when the widget is about to be removed from its
<GtkRoot> widget. Must chain up
size-allocateCalled to set the allocation, if the widget does not have a layout manager.
state-flags-changedSignal emitted when the widget state changes, see widget:get-state-flags.
direction-changedSignal emitted when the text direction of a widget changes.
get-request-modeCalled to get the request mode, if the widget does not have a layout
manager. This allows a widget to tell its parent container whether it
prefers to be allocated in
height-for-width or
width-for-height mode.
height-for-width means the widget prefers
to have GtkWidgetClass.measure() called first to get the default
width (passing a for_size of -1), then again to get the height for said
default width. constant-size disables any
height-for-width or width-for-height geometry management for said widget
and is the default return. It’s important to note that any widget which
trades height-for-width or width-for-height must respond properly to a
for_size value >= -1 passed to GtkWidgetClass.measure, for both
possible orientations.
measureCalled to obtain the minimum and natural size of the widget, if the widget does not have a layout manager. Depending on the orientation parameter, the passed for_size can be interpreted as width or height. A widget will never be allocated less than its minimum size.
mnemonic-activateActivates the widget if group-cycling is #f, and just
grabs the focus if group-cycling is #t.
grab-focusCauses widget to have the keyboard focus for the
<GtkWindow> it’s inside.
focusVfunc for widget:child-focus?
set-focus-childSets the focused child of a widget. Must chain up
move-focusSignal emitted when a change of focus is requested
keynav-failedSignal emitted if keyboard navigation fails.
query-tooltipSignal emitted when “has-tooltip” is #t and the hover timeout has
expired with the cursor hovering “above” widget; or emitted when widget
got focus in keyboard mode.
compute-expandComputes whether a container should give this widget extra space when possible.
css-changedVfunc called when the CSS used by widget was changed. Widgets should then discard their caches that depend on CSS and queue resizes or redraws accordingly. The default implementation will take care of this for all the default CSS properties, so implementations must chain up.
system-setting-changedEmitted when a system setting was changed. Must chain up.
snapshotVfunc called when a new snapshot of the widget has to be taken.
containsVfunc for widget:contains?.
Installs a shortcut in self.
Every instance created for self or its subclasses will inherit this shortcut and trigger it.
Shortcuts added this way will be triggered in the
Gtk.PropagationPhase.bubble phase, which means they may also
trigger if child widgets have focus.
This function must only be used in class initialization functions otherwise it is not guaranteed that the shortcut will be installed.
Passed: a <GtkWidgetClass>.
the class to add the shortcut to
Passed: a <GtkShortcut>.
the shortcut to add
Associates a name to be used in GtkBuilder XML with a symbol.
This function is not supported after widget-class:set-template-scope has been used on
self.
See builder-cscope:add-callback-symbol.
Note that this must be called from a composite widget classes class
initializer after calling widget-class:set-template.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
name of the callback as expected in the template XML
Passed: a procedure.
the callback symbol
See GCallback for how it is called.
Assigns an object declared in the class template XML to be set to a
location on a freshly built instance’s private data, or alternatively
accessible via widget:get-template-child.
The struct can point either into the public instance, then you should
use G_STRUCT_OFFSET(WidgetType, member) for struct-offset,
or in the private struct, then you should use
G_PRIVATE_OFFSET(WidgetType, member).
An explicit strong reference will be held automatically for the duration
of your instance’s life cycle, it will be released automatically when
GObjectClass.dispose() runs on your instance and if a nonzero
struct-offset is specified, then the automatic location in your
instance public or private data will be set to NULL. You can
however access an automated child pointer the first time your classes
GObjectClass.dispose() runs, or alternatively in
widget:destroy.
If internal-child is specified, buildable:do-get-internal-child will be
automatically implemented by the widget class so there is no need to
implement it manually.
The wrapper macros Gtk.widget_class_bind_template_child,
Gtk.widget_class_bind_template_child_internal,
Gtk.widget_class_bind_template_child_private and
Gtk.widget_class_bind_template_child_internal_private might be
more convenient to use.
Note that this must be called from a composite widget classes class
initializer after calling widget-class:set-template.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
ID of the child defined in the template XML
Passed: a boolean.
whether the child should be accessible as an “internal-child” when this class is used in GtkBuilder XML
Passed: a 64-bit integer.
The offset into the composite widget’s instance public or private structure where the automated child pointer should be set, or 0 to not assign the pointer
Retrieves the accessible role used by the given widget class.
Different accessible roles have different states, and are rendered differently by assistive technologies.
See also: accessible:get-accessible-role.
Passed: a <GtkWidgetClass>.
a widget class
Returned: a <GtkAccessibleRole>.
the accessible role for the widget class
Retrieves the signal id for the activation signal.
The activation signal is set using widget-class:set-activate-signal.
Passed: a <GtkWidgetClass>.
a widget class
Returned: an unsigned 32-bit integer.
a signal id, or 0 if the widget class does not specify an activation signal
Gets the name used by this class for matching in CSS code.
See widget-class:set-css-name for
details.
Passed: a <GtkWidgetClass>.
class to set the name on
Returned: a string.
the CSS name of the given class
Retrieves the type of the <GtkLayoutManager>
used by widgets of class self.
See also: widget-class:set-layout-manager-type.
Passed: a <GtkWidgetClass>.
a widget class
Returned: a class, or a GType number.
type of a <GtkLayoutManager> subclass, or
G_TYPE_INVALID
Adds an action for all instances of a widget class.
This function should be called at class initialization time.
Actions installed by this function are stateless. The only state they
have is whether they are enabled or not (which can be changed with
widget:action-set-enabled).
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
a prefixed action name, such as "clipboard.paste"
Passed: a string, or #f.
the parameter type
Passed: a procedure.
callback to use when the action is activated
See GtkWidgetActionActivateFunc
for how it is called.
Installs an action called action-name on self and binds its state to the value of the property-name property.
This function will perform a few sanity checks on the property selected via property-name. Namely, the property must exist, must be readable, writable and must not be construct-only. There are also restrictions on the type of the given property, it must be boolean, int, unsigned int, double or string. If any of these conditions are not met, a critical warning will be printed and no action will be added.
The state type of the action matches the property type.
If the property is boolean, the action will have no parameter and toggle the property value. Otherwise, the action will have a parameter of the same type as the property.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
name of the action
Passed: a string.
name of a property in instances of self or any parent class
Returns details about an action that has been installed for self.
See widget-class:install-action
for details on how to install actions.
Note that this function will also return actions defined by parent classes. You can identify those by looking at owner.
Passed: a <GtkWidgetClass>.
a widget class
Passed: an unsigned 32-bit integer.
position of the action to query
Returned: a boolean.
true if the action was found
Returned: a class, or a GType number.
return location for the type where the action was defined
Returned: a string.
return location for the action name
Returned: a <GVariantType>, or #f.
return location for the parameter type
Returned: a string, or #f.
return location for the property name
Sets the accessible role used by the given widget class.
Different accessible roles have different states, and are rendered differently by assistive technologies.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a <GtkAccessibleRole>, or one of
its symbols.
the accessible role to use
Sets the activation signal for a widget class.
The signal will be emitted when calling widget:activate?.
The signal-id must have been registered with
[function.GObject.signal_new] or GObject.signal_newv before
calling this function.
Passed: a <GtkWidgetClass>.
a widget class
Passed: an unsigned 32-bit integer.
the id for the activate signal
Sets the activation signal for a widget class.
The signal id will by looked up by signal-name.
The signal will be emitted when calling widget:activate?.
The signal-name must have been registered with
[function.GObject.signal_new] or GObject.signal_newv before
calling this function.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
the name of the activate signal of widget-type
Sets the name to be used for CSS matching of widgets.
If this function is not called for a given class, the name set on the
parent class is used. By default, <GtkWidget> uses
the name "widget".
Passed: a <GtkWidgetClass>.
class to set the name on
Passed: a string.
name to use
Sets the type to be used for creating layout managers for widgets of self.
The given type must be a subtype of
<GtkLayoutManager>.
This function should only be called from class init functions of widgets.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a class, or a GType number.
the object type that implements the
<GtkLayoutManager> for self
This should be called at class initialization time to specify the
<GtkBuilder> XML to be used to extend a widget.
For convenience, widget-class:set-template-from-resource is
also provided.
Note that any class that installs templates must call widget:init-template in the widget’s instance
initializer.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a <GBytes>.
<GBytes> holding the
<GtkBuilder> XML
A convenience function that calls widget-class:set-template with the contents of a
resource.
Note that any class that installs templates must call widget:init-template in the widget’s instance
initializer.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a string.
resource path to load the template from
Overrides the default scope to be used when parsing the class template.
This function is intended for language bindings.
Note that this must be called from a composite widget classes class
initializer after calling widget-class:set-template.
Passed: a <GtkWidgetClass>.
a widget class
Passed: a <GtkBuilderScope>.
<GtkBuilderScope> to use when loading the
class template