Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Widget

[222:7] extends: object

The base class for all widgets. It manages the widget lifecycle, layout, states and style. ### Minimum and natural size In order to understand geometry management of widgets in GTK, it is helpful to understand the different terminology surrounding sizing of widgets. The two primary terms are: minimum size and natural size. As a general rule: the minimum size is the size required to display the minimum amount of content in a widget. A widget cannot be allocated less than the minimum size it requires. The natural size is the amount of content that a widget prefers to display in normal conditions. A widget may be allocated more than the natural size it prefers, or less, depending on the layout management of its parent container. What to do when the widget is allocated a different size than the one it prefers is entirely left to the widget implementation: some widgets decide to add extra room, other widgets may disclose additional content, other widgets may decide to hide content, or show a different layout entirely. ### Height-for-width Geometry Management GTK uses a height-for-width (and width-for-height) geometry management system. Height-for-width means that a widget can change how much vertical space it needs, depending on the amount of horizontal space that it is given (and similar for width-for-height). The most common example is a label that reflows to fill up the available width, wraps to fewer lines, and therefore needs less height. Height-for-width geometry management is implemented in GTK by way of two virtual methods: - [vfunc@Gtk.Widget.get_request_mode] - [vfunc@Gtk.Widget.measure] There are some important things to keep in mind when implementing height-for-width and when using it in widget implementations. If you implement a direct GtkWidget subclass that supports height-for-width or width-for-height geometry management for itself or its child widgets, the [vfunc@Gtk.Widget.get_request_mode] virtual function must be implemented as well and return the widget's preferred request mode. The default implementation of this virtual function returns %GTK_SIZE_REQUEST_CONSTANT_SIZE, which means that the widget will only ever get -1 passed as the for_size value to its [vfunc@Gtk.Widget.measure] implementation. The geometry management system will query a widget hierarchy in only one orientation at a time. When widgets are initially queried for their minimum sizes it is generally done in two initial passes in the [enum@Gtk.SizeRequestMode] chosen by the toplevel. For example, when queried in the normal %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH mode: First, the default minimum and natural width for each widget in the interface will be computed using [method@Gtk.Widget.measure] with an orientation of %GTK_ORIENTATION_HORIZONTAL and a for_size of -1. Because the preferred widths for each widget depend on the preferred widths of their children, this information propagates up the hierarchy, and finally a minimum and natural width is determined for the entire toplevel. Next, the toplevel will use the minimum width to query for the minimum height contextual to that width using [method@Gtk.Widget.measure] with an orientation of %GTK_ORIENTATION_VERTICAL and a for_size of the just computed width. This will also be a highly recursive operation. The minimum height for the minimum width is normally used to set the minimum size constraint on the toplevel. After the toplevel window has initially requested its size in both dimensions it can go on to allocate itself a reasonable size (or a size previously specified with [method@Gtk.Window.set_default_size]). During the recursive allocation process it’s important to note that request cycles will be recursively executed while widgets allocate their children. Each widget, once allocated a size, will go on to first share the space in one orientation among its children and then request each child's height for its target allocated width or its width for allocated height, depending. In this way a widget will typically be requested its size a number of times before actually being allocated a size. The size a widget is finally allocated can of course differ from the size it has requested. For this reason, GtkWidget caches a small number of results to avoid re-querying for the same sizes in one allocation cycle. If a widget does move content around to intelligently use up the allocated size then it must support the request in both GtkSizeRequestModes even if the widget in question only trades sizes in a single orientation. For instance, a [class@Gtk.Label] that does height-for-width word wrapping will not expect to have [vfunc@Gtk.Widget.measure] with an orientation of %GTK_ORIENTATION_VERTICAL called because that call is specific to a width-for-height request. In this case the label must return the height required for its own minimum possible width. By following this rule any widget that handles height-for-width or width-for-height requests will always be allocated at least enough space to fit its own content. Here are some examples of how a %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH widget generally deals with width-for-height requests: c static void foo_widget_measure (GtkWidget *widget, GtkOrientation orientation, int for_size, int *minimum_size, int *natural_size, int *minimum_baseline, int *natural_baseline) { if (orientation == GTK_ORIENTATION_HORIZONTAL) { // Calculate minimum and natural width } else // VERTICAL { if (i_am_in_height_for_width_mode) { int min_width, dummy; // First, get the minimum width of our widget GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1, &min_width, &dummy, &dummy, &dummy); // Now use the minimum width to retrieve the minimum and natural height to display // that width. GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width, minimum_size, natural_size, &dummy, &dummy); } else { // ... some widgets do both. } } } Often a widget needs to get its own request during size request or allocation. For example, when computing height it may need to also compute width. Or when deciding how to use an allocation, the widget may need to know its natural size. In these cases, the widget should be careful to call its virtual methods directly, like in the code example above. It will not work to use the wrapper function [method@Gtk.Widget.measure] inside your own [vfunc@Gtk.Widget.size_allocate] implementation. These return a request adjusted by [class@Gtk.SizeGroup], the widget's align and expand flags, as well as its CSS style. If a widget used the wrappers inside its virtual method implementations, then the adjustments (such as widget margins) would be applied twice. GTK therefore does not allow this and will warn if you try to do it. Of course if you are getting the size request for another widget, such as a child widget, you must use [method@Gtk.Widget.measure]; otherwise, you would not properly consider widget margins, [class@Gtk.SizeGroup], and so forth. GTK also supports baseline vertical alignment of widgets. This means that widgets are positioned such that the typographical baseline of widgets in the same row are aligned. This happens if a widget supports baselines, has a vertical alignment using baselines, and is inside a widget that supports baselines and has a natural “row” that it aligns to the baseline, or a baseline assigned to it by the grandparent. Baseline alignment support for a widget is also done by the [vfunc@Gtk.Widget.measure] virtual function. It allows you to report both a minimum and natural size. If a widget ends up baseline aligned it will be allocated all the space in the parent as if it was %GTK_ALIGN_FILL, but the selected baseline can be found via [method@Gtk.Widget.get_baseline]. If the baseline has a value other than -1 you need to align the widget such that the baseline appears at the position. ### GtkWidget as GtkBuildable The GtkWidget implementation of the GtkBuildable interface supports various custom elements to specify additional aspects of widgets that are not directly expressed as properties. If the widget uses a [class@Gtk.LayoutManager], GtkWidget supports a custom <layout> element, used to define layout properties: xml <object class="GtkGrid" id="my_grid"> <child> <object class="GtkLabel" id="label1"> <property name="label">Description</property> <layout> <property name="column">0</property> <property name="row">0</property> <property name="row-span">1</property> <property name="column-span">1</property> </layout> </object> </child> <child> <object class="GtkEntry" id="description_entry"> <layout> <property name="column">1</property> <property name="row">0</property> <property name="row-span">1</property> <property name="column-span">1</property> </layout> </object> </child> </object> GtkWidget allows style information such as style classes to be associated with widgets, using the custom <style> element: xml <object class="GtkButton" id="button1"> <style> <class name="my-special-button-class"/> <class name="dark-button"/> </style> </object> GtkWidget allows defining accessibility information, such as properties, relations, and states, using the custom <accessibility> element: xml <object class="GtkButton" id="button1"> <accessibility> <property name="label">Download</property> <relation name="labelled-by">label1</relation> </accessibility> </object> ### Building composite widgets from template XML GtkWidget exposes some facilities to automate the procedure of creating composite widgets using "templates". To create composite widgets with GtkBuilder XML, one must associate the interface description with the widget class at class initialization time using [method@Gtk.WidgetClass.set_template]. The interface description semantics expected in composite template descriptions is slightly different from regular [class@Gtk.Builder] XML. Unlike regular interface descriptions, [method@Gtk.WidgetClass.set_template] will expect a <template> tag as a direct child of the toplevel <interface> tag. The <template> tag must specify the “class” attribute which must be the type name of the widget. Optionally, the “parent” attribute may be specified to specify the direct parent type of the widget type; this is ignored by GtkBuilder but can be used by UI design tools to introspect what kind of properties and internal children exist for a given type when the actual type does not exist. The XML which is contained inside the <template> tag behaves as if it were added to the <object> tag defining the widget itself. You may set properties on a widget by inserting <property> tags into the <template> tag, and also add <child> tags to add children and extend a widget in the normal way you would with <object> tags. Additionally, <object> tags can also be added before and after the initial <template> tag in the normal way, allowing one to define auxiliary objects which might be referenced by other widgets declared as children of the <template> tag. Since, unlike the <object> tag, the <template> tag does not contain an “id” attribute, if you need to refer to the instance of the object itself that the template will create, simply refer to the template class name in an applicable element content. Here is an example of a template definition, which includes an example of this in the <signal> tag: xml <interface> <template class="FooWidget" parent="GtkBox"> <property name="orientation">horizontal</property> <property name="spacing">4</property> <child> <object class="GtkButton" id="hello_button"> <property name="label">Hello World</property> <signal name="clicked" handler="hello_button_clicked" object="FooWidget" swapped="yes"/> </object> </child> <child> <object class="GtkButton" id="goodbye_button"> <property name="label">Goodbye World</property> </object> </child> </template> </interface> Typically, you'll place the template fragment into a file that is bundled with your project, using GResource. In order to load the template, you need to call [method@Gtk.WidgetClass.set_template_from_resource] from the class initialization of your GtkWidget type: c static void foo_widget_class_init (FooWidgetClass *klass) { // ... gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/example/ui/foowidget.ui"); } You will also need to call [method@Gtk.Widget.init_template] from the instance initialization function:

(GTK_WIDGET (self)); // Initialize the rest of the widget... } ``` as well as
calling [method@Gtk.Widget.dispose_template] from the dispose function: ```c
static void foo_widget_dispose (GObject *gobject) { FooWidget *self =
FOO_WIDGET (gobject); // Dispose objects for which you have a reference... //
Clear the template children for this widget type gtk_widget_dispose_template
(GTK_WIDGET (self), FOO_TYPE_WIDGET); G_OBJECT_CLASS
(foo_widget_parent_class)->dispose (gobject); } ``` You can access widgets
defined in the template using the [method@Gtk.Widget.get_template_child]
function, but you will typically declare a pointer in the instance private
data structure of your type using the same name as the widget in the template
definition, and call [method@Gtk.WidgetClass.bind_template_child_full] (or
one of its wrapper macros [func@Gtk.widget_class_bind_template_child] and
[func@Gtk.widget_class_bind_template_child_private]) with that name, e.g.
```c typedef struct { GtkWidget *hello_button; GtkWidget *goodbye_button; }
FooWidgetPrivate; G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget,
GTK_TYPE_BOX) static void foo_widget_dispose (GObject *gobject) {
gtk_widget_dispose_template (GTK_WIDGET (gobject), FOO_TYPE_WIDGET);
G_OBJECT_CLASS (foo_widget_parent_class)->dispose (gobject); } static void
foo_widget_class_init (FooWidgetClass *klass) { // ... G_OBJECT_CLASS
(klass)->dispose = foo_widget_dispose;
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/com/example/ui/foowidget.ui"); gtk_widget_class_bind_template_child_private
(GTK_WIDGET_CLASS (klass), FooWidget, hello_button);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
FooWidget, goodbye_button); } static void foo_widget_init (FooWidget *widget)
{ gtk_widget_init_template (GTK_WIDGET (widget)); } ``` You can also use
[method@Gtk.WidgetClass.bind_template_callback_full] (or is wrapper macro
[func@Gtk.widget_class_bind_template_callback]) to connect a signal callback
defined in the template with a function visible in the scope of the class,
e.g. ```c // the signal handler has the instance and user data swapped //
because of the swapped="yes" attribute in the template XML static void
hello_button_clicked (FooWidget *self, GtkButton *button) { g_print ("Hello,
world!\n"); } static void foo_widget_class_init (FooWidgetClass *klass) { //
... gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/com/example/ui/foowidget.ui"); gtk_widget_class_bind_template_callback
(GTK_WIDGET_CLASS (klass), hello_button_clicked); } ```

#### Members
- **handleObj**
- **lib**
- **retainedCallbacks**
- **signalHandlerNames**
- **signalSetterHandlers**

#### Methods

- **Widget** (`Handle = null`)

	> Creates a new `Widget` by wrapping a native handle or another wrapper.

	- **@p** `Handle` is the native handle or another wrapper whose handle to adopt.


- **toNativeHandle** (`Source`)

	> Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from `fn.call(...)`, another generated wrapper exposing `handle()`, or null. Returns null when the argument carries no pointer.

	- **@p** `Source` is the raw handle, raw buffer, wrapper, or null.
	- **@r** `A` raw pointer carrier or null when no pointer is present.


- **getLib** ()

	> Returns the opened native library for this generated wrapper.

	- **@r** `The` opened native library.


- **handle** ()

	> Returns the wrapped NativeHandle.

	- **@r** `The` wrapped NativeHandle.


- **isNull** ()

	> Returns true when the wrapped handle is null.

	- **@r** `A` bool.


- **describe** ()

	> Returns a small string for debugging generated wrappers.

	- **@r** `A` string.


- **asInitiallyUnowned** ()

	> Wraps this handle as `InitiallyUnowned`.

	- **@r** `A` `InitiallyUnowned` object.


- **asAccessible** ()

	> Wraps this handle as `Accessible`.

	- **@r** `A` `Accessible` object.


- **asBuildable** ()

	> Wraps this handle as `Buildable`.

	- **@r** `A` `Buildable` object.


- **asConstraintTarget** ()

	> Wraps this handle as `ConstraintTarget`.

	- **@r** `A` `ConstraintTarget` object.


- **connectSignal** (`string Name, CallbackObj`)

	> Connects one generated callback wrapper to a named signal.

	- **@p** `Name` is the signal name.
	- **@p** `CallbackObj` is the generated callback wrapper to connect.
	- **@r** `The` connected handler id.


- **disconnectSignalHandler** (`int HandlerId`)

	> Disconnects one retained signal handler id.

	- **@p** `HandlerId` is the signal handler id to disconnect.
	- **@r** `None.` 


- **setOnDestroy** (`callback Fn, UserData = null`)

	> Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released. This signal is not suitable for saving widget state.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnDirectionchanged** (`callback Fn, UserData = null`)

	> Emitted when the text direction of a widget changes.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, string Previous_direction).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnHide** (`callback Fn, UserData = null`)

	> Emitted when @widget is hidden.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnKeynavfailed** (`callback Fn, UserData = null`)

	> Emitted if keyboard navigation fails. See [method@Gtk.Widget.keynav_failed] for details.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, string Direction).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnMap** (`callback Fn, UserData = null`)

	> Emitted when @widget is going to be mapped. A widget is mapped when the widget is visible (which is controlled with [property@Gtk.Widget:visible]) and all its parents up to the toplevel widget are also visible. The `::map` signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of [signal@Gtk.Widget::unmap].

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnMnemonicactivate** (`callback Fn, UserData = null`)

	> Emitted when a widget is activated via a mnemonic. The default handler for this signal activates @widget if @group_cycling is false, or just makes @widget grab focus if @group_cycling is true.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, bool Group_cycling).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnMovefocus** (`callback Fn, UserData = null`)

	> Emitted when the focus is moved. The `::move-focus` signal is a [keybinding signal](class.SignalAction.html). The default bindings for this signal are <kbd>Tab</kbd> to move forward, and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, string Direction).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnQuerytooltip** (`callback Fn, UserData = null`)

	> Emitted when the widget’s tooltip is about to be shown. This happens when the [property@Gtk.Widget:has-tooltip] property is true and the hover timeout has expired with the cursor hovering above @widget; or emitted when @widget got focus in keyboard mode. Using the given coordinates, the signal handler should determine whether a tooltip should be shown for

	- **@widget.** `If` this is the case true should be returned, false otherwise. Note that if @keyboard_mode is true, the values of @x and @y are undefined and should not be used. The signal handler is free to manipulate @tooltip with the therefore destined function calls.
	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, int X, int Y, bool Keyboard_mode, Tooltip Tooltip).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnRealize** (`callback Fn, UserData = null`)

	> Emitted when @widget is associated with a `GdkSurface`. This means that [method@Gtk.Widget.realize] has been called or the widget has been mapped (that is, it is going to be drawn).

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnShow** (`callback Fn, UserData = null`)

	> Emitted when @widget is shown.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnStateflagschanged** (`callback Fn, UserData = null`)

	> Emitted when the widget state changes. See [method@Gtk.Widget.get_state_flags].

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self, string Flags).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnUnmap** (`callback Fn, UserData = null`)

	> Emitted when @widget is going to be unmapped. A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden. As `::unmap` indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnUnrealize** (`callback Fn, UserData = null`)

	> Emitted when the `GdkSurface` associated with @widget is destroyed. This means that [method@Gtk.Widget.unrealize] has been called or the widget has been unmapped (that is, it is going to be hidden).

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Widget Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **getProperty** (`string Name`)

	> Reads one generated property by name.



- **setProperty** (`string Name, Value`)

	> Writes one generated property by name.



- **setCanfocus** (`bool Value`)

	> Whether the widget or any of its descendents can accept the input focus. This property is meant to be set by widget implementations, typically in their instance init function.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setCantarget** (`bool Value`)

	> Whether the widget can receive pointer events.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setCursor** (`object Value`)

	> The cursor used by @widget.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setFocusonclick** (`bool Value`)

	> Whether the widget should grab focus when it is clicked with the mouse. This property is only relevant for widgets that can take focus.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setFocusable** (`bool Value`)

	> Whether this widget itself will accept the input focus.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setHalign** (`string Value`)

	> How to distribute horizontal space if widget gets extra space.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setHastooltip** (`bool Value`)

	> Enables or disables the emission of the [signal@Gtk.Widget::query-tooltip] signal on @widget. A true value indicates that @widget can have a tooltip, in this case the widget will be queried using [signal@Gtk.Widget::query-tooltip] to determine whether it will provide a tooltip or not.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setHeightrequest** (`int Value`)

	> Overrides for height request of the widget. If this is -1, the natural request will be used.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setHexpand** (`bool Value`)

	> Whether to expand horizontally.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setHexpandset** (`bool Value`)

	> Whether to use the `hexpand` property.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setLayoutmanager** (`object Value`)

	> The [class@Gtk.LayoutManager] instance to use to compute the preferred size of the widget, and allocate its children. This property is meant to be set by widget implementations, typically in their instance init function.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setLimitevents** (`bool Value`)

	> Makes this widget act like a modal dialog, with respect to event delivery. Global event controllers will not handle events with targets inside the widget, unless they are set up to ignore propagation limits. See [method@Gtk.EventController.set_propagation_limit].

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMarginbottom** (`int Value`)

	> Margin on bottom side of widget. This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMarginend** (`int Value`)

	> Margin on end of widget, horizontally. This property supports left-to-right and right-to-left text directions. This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMarginstart** (`int Value`)

	> Margin on start of widget, horizontally. This property supports left-to-right and right-to-left text directions. This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMargintop** (`int Value`)

	> Margin on top side of widget. This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setName** (`string Value`)

	> The name of the widget.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setOpacity** (`double Value`)

	> The requested opacity of the widget.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setOverflow** (`string Value`)

	> How content outside the widget's content area is treated. This property is meant to be set by widget implementations, typically in their instance init function.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setReceivesdefault** (`bool Value`)

	> Whether the widget will receive the default action when it is focused.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setSensitive** (`bool Value`)

	> Whether the widget responds to input.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setTooltipmarkup** (`string Value`)

	> Sets the text of tooltip to be the given string, which is marked up with Pango markup. Also see [method@Gtk.Tooltip.set_markup]. This is a convenience property which will take care of getting the tooltip shown if the given string is not `NULL`: [property@Gtk.Widget:has-tooltip] will automatically be set to true and there will be taken care of [signal@Gtk.Widget::query-tooltip] in the default signal handler. Note that if both [property@Gtk.Widget:tooltip-text] and [property@Gtk.Widget:tooltip-markup] are set, the last one wins.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setTooltiptext** (`string Value`)

	> Sets the text of tooltip to be the given string. Also see [method@Gtk.Tooltip.set_text]. This is a convenience property which will take care of getting the tooltip shown if the given string is not `NULL`: [property@Gtk.Widget:has-tooltip] will automatically be set to true and there will be taken care of [signal@Gtk.Widget::query-tooltip] in the default signal handler. Note that if both [property@Gtk.Widget:tooltip-text] and [property@Gtk.Widget:tooltip-markup] are set, the last one wins.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setValign** (`string Value`)

	> How to distribute vertical space if widget gets extra space.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setVexpand** (`bool Value`)

	> Whether to expand vertically.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setVexpandset** (`bool Value`)

	> Whether to use the `vexpand` property.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setVisible** (`bool Value`)

	> Whether the widget is visible.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setWidthrequest** (`int Value`)

	> Overrides for width request of the widget. If this is -1, the natural request will be used.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **action\_set\_enabled** (`string action_name, bool enabled`)

	> Enables or disables an action installed with [method@Gtk.WidgetClass.install_action].

	- **@p** `action_name` is action name, such as "clipboard.paste".
	- **@p** `enabled` is whether the action is now enabled.
	- **@r** `None.` 


- **activate** ()

	> Activates the widget. The activation will emit the signal set using [method@Gtk.WidgetClass.set_activate_signal] during class initialization. Activation is what happens when you press <kbd>Enter</kbd> on a widget. If you wish to handle the activation keybinding yourself, it is recommended to use [method@Gtk.WidgetClass.add_shortcut] with an action created with [ctor@Gtk.SignalAction.new]. If @widget is not activatable, the function returns false.



- **activate\_action\_variant** (`string name, object args`)

	> Activates an action for the widget. The action is looked up in the action groups associated with @widget and its ancestors. If the action is in an action group added with [method@Gtk.Widget.insert_action_group], the

	- **@name** `is` expected to be prefixed with the prefix that was used when the group was inserted. The arguments must match the actions expected parameter type, as returned by [method@Gio.Action.get_parameter_type].
	- **@p** `name` is the name of the action to activate.
	- **@p** `args` is parameters to use.


- **activate\_default** ()

	> Activates the `default.activate` action for the widget. The action is looked up in the same was as for [method@Gtk.Widget.activate_action].

	- **@r** `None.` 


- **add\_controller** (`object controller`)

	> Adds an event controller to the widget. The event controllers of a widget handle the events that are propagated to the widget. You will usually want to call this function right after creating any kind of [class@Gtk.EventController].

	- **@p** `controller` is an event controller that hasn't been added to a widget yet.
	- **@r** `None.` 


- **add\_css\_class** (`string css_class`)

	> Adds a style class to the widget. After calling this function, the widget’s style will match for @css_class, according to CSS matching rules. Use [method@Gtk.Widget.remove_css_class] to remove the style again.

	- **@p** `css_class` is style class to add to @widget, without the leading period.
	- **@r** `None.` 


- **add\_mnemonic\_label** (`object label`)

	> Adds a widget to the list of mnemonic labels for this widget. See [method@Gtk.Widget.list_mnemonic_labels]. Note that the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well.

	- **@p** `label` is a widget that acts as a mnemonic label for @widget.
	- **@r** `None.` 


- **allocate** (`int width, int height, int baseline, object transform`)

	> Assigns size, position, (optionally) a baseline and transform to a child widget. In this function, the allocation and baseline may be adjusted. The given allocation will be forced to be bigger than the widget's minimum size, as well as at least 0×0 in size. This function is only used by widget implementations. For a version that does not take a transform, see [method@Gtk.Widget.size_allocate].

	- **@p** `width` is new width.
	- **@p** `height` is new height.
	- **@p** `baseline` is new baseline, or -1.
	- **@p** `transform` is transformation to be applied.
	- **@r** `None.` 


- **child\_focus** (`string direction`)

	> Called by widgets as the user moves around the window using keyboard shortcuts. The @direction argument indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). This function calls the [vfunc@Gtk.Widget.focus] virtual function; widgets can override the virtual function in order to implement appropriate focus behavior. The default `focus()` virtual function for a widget should return true if moving in @direction left the focus on a focusable location inside that widget, and false if moving in @direction moved the focus outside the widget. When returning true, widgets normally call [method@Gtk.Widget.grab_focus] to place the focus accordingly; when returning false, they don’t modify the current focus location. This function is used by custom widget implementations; if you're writing an app, you’d use [method@Gtk.Widget.grab_focus] to move the focus to a particular widget.

	- **@p** `direction` is direction of focus movement.


- **compute\_expand** (`string orientation`)

	> Computes whether a parent widget should give this widget extra space when possible. Widgets with children should check this, rather than looking at [method@Gtk.Widget.get_hexpand] or [method@Gtk.Widget.get_vexpand]. This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded. The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.

	- **@p** `orientation` is expand direction.


- **contains** (`double x, double y`)

	> Tests if a given point is contained in the widget. The coordinates for (x, y) must be in widget coordinates, so (0, 0) is assumed to be the top left of @widget's content area.

	- **@p** `x` is X coordinate to test, relative to @widget's origin.
	- **@p** `y` is Y coordinate to test, relative to @widget's origin.


- **create\_pango\_context** ()

	> Creates a new `PangoContext` that is configured for the widget. The `PangoContext` will have the appropriate font map, font options, font description, and base direction set. See also [method@Gtk.Widget.get_pango_context].



- **create\_pango\_layout** (`string text`)

	> Creates a new `PangoLayout` that is configured for the widget. The `PangoLayout` will have the appropriate font map, font description, and base direction set. If you keep a `PangoLayout` created in this way around, you need to re-create it when the widgets `PangoContext` is replaced. This can be tracked by listening to changes of the [property@Gtk.Widget:root] property on the widget.

	- **@p** `text` is text to set on the layout.


- **drag\_check\_threshold** (`int start_x, int start_y, int current_x, int current_y`)

	> Checks to see if a drag movement has passed the GTK drag threshold.

	- **@p** `start_x` is X coordinate of start of drag.
	- **@p** `start_y` is Y coordinate of start of drag.
	- **@p** `current_x` is current X coordinate.
	- **@p** `current_y` is current Y coordinate.


- **error\_bell** ()

	> Notifies the user about an input-related error on the widget. If the [property@Gtk.Settings:gtk-error-bell] setting is true, it calls [method@Gdk.Surface.beep], otherwise it does nothing. Note that the effect of [method@Gdk.Surface.beep] can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

	- **@r** `None.` 


- **get\_allocated\_baseline** ()

	> Returns the baseline that has currently been allocated to the widget. This function is intended to be used when implementing handlers for the `GtkWidget`Class.snapshot() function, and when allocating child widgets in `GtkWidget`Class.size_allocate().



- **get\_allocated\_height** ()

	> Returns the height that has currently been allocated to the widget. To learn more about widget sizes, see the coordinate system [overview](coordinates.html).



- **get\_allocated\_width** ()

	> Returns the width that has currently been allocated to the widget. To learn more about widget sizes, see the coordinate system [overview](coordinates.html).



- **get\_baseline** ()

	> Returns the baseline that has currently been allocated to the widget. This function is intended to be used when implementing handlers for the `GtkWidgetClass.snapshot()` function, and when allocating child widgets in `GtkWidgetClass.size_allocate()`.



- **get\_can\_focus** ()

	> Determines whether the input focus can enter the widget or any of its children. See [method@Gtk.Widget.set_can_focus].



- **get\_can\_target** ()

	> Queries whether the widget can be the target of pointer events.



- **get\_child\_visible** ()

	> Gets the value set with [method@Gtk.Widget.set_child_visible]. If you feel a need to use this function, your code probably needs reorganization. This function is only useful for widget implementations and should never be called by an application.



- **get\_clipboard** ()

	> Gets the clipboard object for the widget. This is a utility function to get the clipboard object for the display that @widget is using. Note that this function always works, even when @widget is not realized yet.



- **get\_css\_classes** ()

	> Returns the list of style classes applied to the widget.



- **get\_css\_name** ()

	> Returns the CSS name of the widget.



- **get\_cursor** ()

	> Gets the cursor set on the widget. See [method@Gtk.Widget.set_cursor] for details.



- **get\_direction** ()

	> Gets the reading direction for the widget. See [method@Gtk.Widget.set_direction].



- **get\_display** ()

	> Get the display for the window that the widget belongs to. This function can only be called after the widget has been added to a widget hierarchy with a `GtkRoot` at the top. In general, you should only create display-specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.



- **get\_first\_child** ()

	> Returns the widget’s first child. This function is primarily meant for widget implementations.



- **get\_focus\_child** ()

	> Returns the focus child of the widget.



- **get\_focus\_on\_click** ()

	> Returns whether the widget should grab focus when it is clicked with the mouse. See [method@Gtk.Widget.set_focus_on_click].



- **get\_focusable** ()

	> Determines whether the widget can own the input focus. See [method@Gtk.Widget.set_focusable].



- **get\_font\_map** ()

	> Gets the font map of the widget. See [method@Gtk.Widget.set_font_map].



- **get\_font\_options** ()

	> Returns the `cairo_font_options_t` of the widget. Seee [method@Gtk.Widget.set_font_options].



- **get\_frame\_clock** ()

	> Obtains the frame clock for a widget. The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call [method@Gdk.FrameClock.get_frame_time], in order to get a time to use for animating. For example you might record the start of the animation with an initial value from [method@Gdk.FrameClock.get_frame_time], and then update the animation by calling [method@Gdk.FrameClock.get_frame_time] again during each repaint. [method@Gdk.FrameClock.request_phase] will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use [method@Gtk.Widget.queue_draw] which invalidates the widget (thus scheduling it to receive a draw on the next frame). [method@Gtk.Widget.queue_draw] will also end up requesting a frame on the appropriate frame clock. A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock. Unrealized widgets do not have a frame clock.



- **get\_halign** ()

	> Gets the horizontal alignment of the widget. For backwards compatibility reasons this method will never return one of the baseline alignments, but instead it will convert it to [enum@Gtk.Align.fill] or [enum@Gtk.Align.center]. Baselines are not supported for horizontal alignment.



- **get\_has\_tooltip** ()

	> Returns the current value of the `has-tooltip` property.



- **get\_height** ()

	> Returns the content height of the widget. This function returns the height passed to its size-allocate implementation, which is the height you should be using in [vfunc@Gtk.Widget.snapshot]. For pointer events, see [method@Gtk.Widget.contains]. To learn more about widget sizes, see the coordinate system [overview](coordinates.html).



- **get\_hexpand** ()

	> Gets whether the widget would like any available extra horizontal space. When a user resizes a window, widgets with expand set to true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand. Widgets with children should use [method@Gtk.Widget.compute_expand] rather than this function, to see whether any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also. This function only looks at the widget’s own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.



- **get\_hexpand\_set** ()

	> Gets whether the `hexpand` flag has been explicitly set. If [property@Gtk.Widget:hexpand] property is set, then it overrides any computed expand value based on child widgets. If `hexpand` is not set, then the expand value depends on whether any children of the widget would like to expand. There are few reasons to use this function, but it’s here for completeness and consistency.



- **get\_last\_child** ()

	> Returns the widget’s last child. This function is primarily meant for widget implementations.



- **get\_layout\_manager** ()

	> Retrieves the layout manager of the widget. See [method@Gtk.Widget.set_layout_manager].



- **get\_limit\_events** ()

	> Gets the value of the [property@Gtk.Widget:limit-events] property.



- **get\_mapped** ()

	> Returns whether the widget is mapped.



- **get\_margin\_bottom** ()

	> Gets the bottom margin of the widget.



- **get\_margin\_end** ()

	> Gets the end margin of the widget.



- **get\_margin\_start** ()

	> Gets the start margin of the widget.



- **get\_margin\_top** ()

	> Gets the top margin of the widget.



- **get\_name** ()

	> Retrieves the name of a widget. See [method@Gtk.Widget.set_name] for the significance of widget names.



- **get\_native** ()

	> Returns the nearest `GtkNative` ancestor of the widget. This function will return `NULL` if the widget is not contained inside a widget tree with a native ancestor. `GtkNative` widgets will return themselves here.



- **get\_next\_sibling** ()

	> Returns the widget’s next sibling. This function is primarily meant for widget implementations.



- **get\_opacity** ()

	> Fetches the requested opacity for the widget. See [method@Gtk.Widget.set_opacity].



- **get\_overflow** ()

	> Returns the widget’s overflow value.



- **get\_pango\_context** ()

	> Gets a `PangoContext` that is configured for the widget. The `PangoContext` will have the appropriate font map, font description, and base direction set. Unlike the context returned by [method@Gtk.Widget.create_pango_context], this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by listening to changes of the [property@Gtk.Widget:root] property on the widget.



- **get\_parent** ()

	> Returns the parent widget of the widget.



- **get\_prev\_sibling** ()

	> Returns the widget’s previous sibling. This function is primarily meant for widget implementations.



- **get\_primary\_clipboard** ()

	> Gets the primary clipboard of the widget. This is a utility function to get the primary clipboard object for the display that @widget is using. Note that this function always works, even when @widget is not realized yet.



- **get\_realized** ()

	> Determines whether the widget is realized.



- **get\_receives\_default** ()

	> Determines whether the widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default. See [method@Gtk.Widget.set_receives_default].



- **get\_request\_mode** ()

	> Gets whether the widget prefers a height-for-width layout or a width-for-height layout. Single-child widgets generally propagate the preference of their child, more complex widgets need to request something either in context of their children or in context of their allocation capabilities.



- **get\_root** ()

	> Returns the `GtkRoot` widget of the widget. This function will return `NULL` if the widget is not contained inside a widget tree with a root widget. `GtkRoot` widgets will return themselves here.



- **get\_scale\_factor** ()

	> Retrieves the internal scale factor that maps from window coordinates to the actual device pixels. On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2). See [method@Gdk.Surface.get_scale_factor]. Note that modern systems may support *fractional* scaling, where the scale factor is not an integer. On such systems, this function will return the next higher integer value, but you probably want to use [method@Gdk.Surface.get_scale] to get the fractional scale value.



- **get\_sensitive** ()

	> Returns the widget’s sensitivity. This function returns the value that has been set using [method@Gtk.Widget.set_sensitive]). The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See [method@Gtk.Widget.is_sensitive].



- **get\_settings** ()

	> Gets the settings object holding the settings used for the widget. Note that this function can only be called when the `GtkWidget` is attached to a toplevel, since the settings object is specific to a particular display. If you want to monitor the widget for changes in its settings, connect to the `notify::display` signal.



- **get\_size** (`string orientation`)

	> Returns the content width or height of the widget. Which dimension is returned depends on @orientation. This is equivalent to calling [method@Gtk.Widget.get_width] for [enum@Gtk.Orientation.horizontal] or [method@Gtk.Widget.get_height] for [enum@Gtk.Orientation.vertical], but can be used when writing orientation-independent code, such as when implementing [iface@Gtk.Orientable] widgets. To learn more about widget sizes, see the coordinate system [overview](coordinates.html).

	- **@p** `orientation` is the orientation to query.


- **get\_state\_flags** ()

	> Returns the widget state as a flag set. It is worth mentioning that the effective [flags@Gtk.StateFlags.insensitive] state will be returned, that is, also based on parent insensitivity, even if @widget itself is sensitive. Also note that if you are looking for a way to obtain the [flags@Gtk.StateFlags] to pass to a [class@Gtk.StyleContext] method, you should look at [method@Gtk.StyleContext.get_state].



- **get\_style\_context** ()

	> Returns the style context associated to the widget. The returned object is guaranteed to be the same for the lifetime of @widget.



- **get\_tooltip\_markup** ()

	> Gets the contents of the tooltip for the widget. If the tooltip has not been set using [method@Gtk.Widget.set_tooltip_markup], this function returns `NULL`.



- **get\_tooltip\_text** ()

	> Gets the contents of the tooltip for the widget. If the @widget's tooltip was set using [method@Gtk.Widget.set_tooltip_markup], this function will return the escaped text.



- **get\_valign** ()

	> Gets the vertical alignment of the widget.



- **get\_vexpand** ()

	> Gets whether the widget would like any available extra vertical space. See [method@Gtk.Widget.get_hexpand] for more detail.



- **get\_vexpand\_set** ()

	> Gets whether the `vexpand` flag has been explicitly set. See [method@Gtk.Widget.get_hexpand_set] for more detail.



- **get\_visible** ()

	> Determines whether the widget is visible. If you want to take into account whether the widget’s parent is also marked as visible, use [method@Gtk.Widget.is_visible] instead. This function does not check if the widget is obscured in any way. See [method@Gtk.Widget.set_visible].



- **get\_width** ()

	> Returns the content width of the widget. This function returns the width passed to its size-allocate implementation, which is the width you should be using in [vfunc@Gtk.Widget.snapshot]. For pointer events, see [method@Gtk.Widget.contains]. To learn more about widget sizes, see the coordinate system [overview](coordinates.html).



- **grab\_focus** ()

	> Causes @widget to have the keyboard focus for the window that it belongs to. If @widget is not focusable, or its [vfunc@Gtk.Widget.grab_focus] implementation cannot transfer the focus to a descendant of @widget that is focusable, it will not take focus and false will be returned. Calling [method@Gtk.Widget.grab_focus] on an already focused widget is allowed, should not have an effect, and return true.



- **has\_css\_class** (`string css_class`)

	> Returns whether a style class is currently applied to the widget.

	- **@p** `css_class` is style class, without the leading period.


- **has\_default** ()

	> Determines whether the widget is the current default widget within its toplevel.



- **has\_focus** ()

	> Determines if the widget has the global input focus. See [method@Gtk.Widget.is_focus] for the difference between having the global input focus, and only having the focus within a toplevel.



- **has\_visible\_focus** ()

	> Determines if the widget should show a visible indication that it has the global input focus. This is a convenience function that takes into account whether focus indication should currently be shown in the toplevel window of @widget. See [method@Gtk.Window.get_focus_visible] for more information about focus indication. To find out if the widget has the global input focus, use [method@Gtk.Widget.has_focus].



- **hide** ()

	> Reverses the effects of [method.Gtk.Widget.show]. This is causing the widget to be hidden (invisible to the user).

	- **@r** `None.` 


- **in\_destruction** ()

	> Returns whether the widget is currently being destroyed. This information can sometimes be used to avoid doing unnecessary work.



- **init\_template** ()

	> Creates and initializes child widgets defined in templates. This function must be called in the instance initializer for any class which assigned itself a template using [method@Gtk.WidgetClass.set_template]. It is important to call this function in the instance initializer of a widget subclass and not in `GObject.constructed()` or `GObject.constructor()` for two reasons: - derived widgets will assume that the composite widgets defined by its parent classes have been created in their relative instance initializers - when calling `g_object_new()` on a widget with composite templates, it’s important to build the composite widgets before the construct properties are set. Properties passed to `g_object_new()` should take precedence over properties set in the private template XML A good rule of thumb is to call this function as the first thing in an instance initialization function.

	- **@r** `None.` 


- **insert\_action\_group** (`string name, object group`)

	> Inserts an action group into the widget's actions. Children of @widget that implement [iface@Gtk.Actionable] can then be associated with actions in @group by setting their “action-name” to @prefix.`action-name`. Note that inheritance is defined for individual actions. I.e. even if you insert a group with prefix @prefix, actions with the same prefix will still be inherited from the parent, unless the group contains an action with the same name. If @group is `NULL`, a previously inserted group for

	- **@name** `is` removed from @widget.
	- **@p** `name` is the prefix for actions in @group.
	- **@p** `group` is an action group.
	- **@r** `None.` 


- **insert\_after** (`object parent, object previous_sibling`)

	> Sets the parent widget of the widget. In contrast to [method@Gtk.Widget.set_parent], this function inserts @widget at a specific position into the list of children of the @parent widget. It will be placed after @previous_sibling, or at the beginning if

	- **@previous_sibling** `is` `NULL`. After calling this function, `gtk_widget_get_prev_sibling (widget)` will return @previous_sibling. If
	- **@parent** `is` already set as the parent widget of @widget, this function can also be used to reorder @widget in the child widget list of @parent. This function is primarily meant for widget implementations; if you are just using a widget, you *must* use its own API for adding children.
	- **@p** `parent` is the parent widget to insert @widget into.
	- **@p** `previous_sibling` is the new previous sibling of @widget.
	- **@r** `None.` 


- **insert\_before** (`object parent, object next_sibling`)

	> Sets the parent widget of the widget. In contrast to [method@Gtk.Widget.set_parent], this function inserts @widget at a specific position into the list of children of the @parent widget. It will be placed before @next_sibling, or at the end if @next_sibling is `NULL`. After calling this function, `gtk_widget_get_next_sibling (widget)` will return @next_sibling. If @parent is already set as the parent widget of @widget, this function can also be used to reorder

	- **@widget** `in` the child widget list of @parent. This function is primarily meant for widget implementations; if you are just using a widget, you *must* use its own API for adding children.
	- **@p** `parent` is the parent widget to insert @widget into.
	- **@p** `next_sibling` is the new next sibling of @widget.
	- **@r** `None.` 


- **is\_ancestor** (`object ancestor`)

	> Determines whether the widget is a descendent of @ancestor.

	- **@p** `ancestor` is another `GtkWidget`.


- **is\_drawable** ()

	> Determines whether the widget can be drawn to. A widget can be drawn if it is mapped and visible.



- **is\_focus** ()

	> Determines if the widget is the focus widget within its toplevel. This does not mean that the [property@Gtk.Widget:has-focus] property is necessarily set; [property@Gtk.Widget:has-focus] will only be set if the toplevel widget additionally has the global input focus.



- **is\_sensitive** ()

	> Returns the widget’s effective sensitivity. This means it is sensitive itself and also its parent widget is sensitive.



- **is\_visible** ()

	> Determines whether the widget and all its parents are marked as visible. This function does not check if the widget is obscured in any way. See also [method@Gtk.Widget.get_visible] and [method@Gtk.Widget.set_visible].



- **keynav\_failed** (`string direction`)

	> Emits the [signal@Gtk.Widget::keynav-failed] signal on the widget. This function should be called whenever keyboard navigation within a single widget hits a boundary. The return value of this function should be interpreted in a way similar to the return value of [method@Gtk.Widget.child_focus]. When true is returned, stay in the widget, the failed keyboard navigation is ok and/or there is nowhere we can/should move the focus to. When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling [method@Gtk.Widget.child_focus] on the widget’s toplevel. The default [signal@Gtk.Widget::keynav-failed] handler returns false for [enum@Gtk.DirectionType.tab-forward] and [enum@Gtk.DirectionType.tab-backward]. For the other values of [enum@Gtk.DirectionType] it returns true. Whenever the default handler returns true, it also calls [method@Gtk.Widget.error_bell] to notify the user of the failed keyboard navigation. A use case for providing an own implementation of `::keynav-failed` (either by connecting to it or by overriding it) would be a row of [class@Gtk.Entry] widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

	- **@p** `direction` is direction of focus movement.


- **list\_mnemonic\_labels** ()

	> Returns the widgets for which this widget is the target of a mnemonic. Typically, these widgets will be labels. See, for example, [method@Gtk.Label.set_mnemonic_widget]. The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call `g_list_foreach (result, (GFunc)g_object_ref, NULL)` first, and then unref all the widgets afterwards.



- **FnMap** ()

	> Causes a widget to be mapped if it isn’t already. This function is only for use in widget implementations.

	- **@r** `None.` 


- **mnemonic\_activate** (`bool group_cycling`)

	> Emits the [signal@Gtk.Widget::mnemonic-activate] signal.

	- **@p** `group_cycling` is true if there are other widgets with the same mnemonic.


- **observe\_children** ()

	> Returns a list model to track the children of the widget. Calling this function will enable extra internal bookkeeping to track children and emit signals on the returned listmodel. It may slow down operations a lot. Applications should try hard to avoid calling this function because of the slowdowns.



- **observe\_controllers** ()

	> Returns a list model to track the event controllers of the widget. Calling this function will enable extra internal bookkeeping to track controllers and emit signals on the returned listmodel. It may slow down operations a lot. Applications should try hard to avoid calling this function because of the slowdowns.



- **pick** (`double x, double y, string flags`)

	> Finds the descendant of the widget closest to a point. The point (x, y) must be given in widget coordinates, so (0, 0) is assumed to be the top left of @widget's content area. Usually widgets will return `NULL` if the given coordinate is not contained in @widget checked via [method@Gtk.Widget.contains]. Otherwise they will recursively try to find a child that does not return `NULL`. Widgets are however free to customize their picking algorithm. This function is used on the toplevel to determine the widget below the mouse cursor for purposes of hover highlighting and delivering events.

	- **@p** `x` is x coordinate to test, relative to @widget's origin.
	- **@p** `y` is y coordinate to test, relative to @widget's origin.
	- **@p** `flags` is flags to influence what is picked.


- **queue\_allocate** ()

	> Flags the widget for a rerun of the [vfunc@Gtk.Widget.size_allocate] function. Use this function instead of [method@Gtk.Widget.queue_resize] when the @widget's size request didn't change but it wants to reposition its contents. An example user of this function is [method@Gtk.Widget.set_halign]. This function is only for use in widget implementations.

	- **@r** `None.` 


- **queue\_draw** ()

	> Schedules this widget to be redrawn. The redraw will happen in the paint phase of the current or the next frame. This means @widget's [vfunc@Gtk.Widget.snapshot] implementation will be called.

	- **@r** `None.` 


- **queue\_resize** ()

	> Flags a widget to have its size renegotiated. This should be called when a widget for some reason has a new size request. For example, when you change the text in a [class@Gtk.Label], the label queues a resize to ensure there’s enough space for the new text. Note that you cannot call gtk_widget_queue_resize() on a widget from inside its implementation of the [vfunc@Gtk.Widget.size_allocate] virtual method. Calls to gtk_widget_queue_resize() from inside [vfunc@Gtk.Widget.size_allocate] will be silently ignored. This function is only for use in widget implementations.

	- **@r** `None.` 


- **realize** ()

	> Creates the GDK resources associated with a widget. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically. Realizing a widget requires all the widget’s parent widgets to be realized; calling this function realizes the widget’s parents in addition to @widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen. This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as [signal@Gtk.Widget::realize].

	- **@r** `None.` 


- **remove\_controller** (`object controller`)

	> Removes an event controller from the widget. The removed event controller will not receive any more events, and should not be used again. Widgets will remove all event controllers automatically when they are destroyed, there is normally no need to call this function.

	- **@p** `controller` is an event controller.
	- **@r** `None.` 


- **remove\_css\_class** (`string css_class`)

	> Removes a style from the widget. After this, the style of @widget will stop matching for @css_class.

	- **@p** `css_class` is style class to remove from @widget, without the leading period.
	- **@r** `None.` 


- **remove\_mnemonic\_label** (`object label`)

	> Removes a widget from the list of mnemonic labels for this widget. See [method@Gtk.Widget.list_mnemonic_labels]. The widget must have previously been added to the list with [method@Gtk.Widget.add_mnemonic_label].

	- **@p** `label` is a widget that is a mnemonic label for @widget.
	- **@r** `None.` 


- **remove\_tick\_callback** (`int id`)

	> Removes a tick callback previously registered with [method@Gtk.Widget.add_tick_callback].

	- **@p** `id` is an ID returned by [method@Gtk.Widget.add_tick_callback].
	- **@r** `None.` 


- **set\_can\_focus** (`bool can_focus`)

	> Sets whether the input focus can enter the widget or any of its children. Applications should set @can_focus to false to mark a widget as for pointer/touch use only. Note that having @can_focus be true is only one of the necessary conditions for being focusable. A widget must also be sensitive and focusable and not have an ancestor that is marked as not can-focus in order to receive input focus. See [method@Gtk.Widget.grab_focus] for actually setting the input focus on a widget.

	- **@p** `can_focus` is whether the input focus can enter the widget or any of its children.
	- **@r** `None.` 


- **set\_can\_target** (`bool can_target`)

	> Sets whether the widget can be the target of pointer events.

	- **@p** `can_target` is whether this widget should be able to receive pointer events.
	- **@r** `None.` 


- **set\_child\_visible** (`bool child_visible`)

	> Sets whether the widget should be mapped along with its parent. The child visibility can be set for widget before it is added to a container with [method@Gtk.Widget.set_parent], to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container. Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself. This function is only useful for widget implementations and should never be called by an application.

	- **@p** `child_visible` is whether @widget should be mapped along with its parent.
	- **@r** `None.` 


- **set\_css\_classes** (`list classes`)

	> Replaces the current style classes of the widget with @classes.

	- **@p** `classes` is `NULL`-terminated list of style classes.
	- **@r** `None.` 


- **set\_cursor** (`object cursor`)

	> Sets the cursor to be shown when the pointer hovers over the widget. If the @cursor is `NULL`, @widget will use the cursor inherited from its parent.

	- **@p** `cursor` is the new cursor.
	- **@r** `None.` 


- **set\_cursor\_from\_name** (`string name`)

	> Sets the cursor to be shown when the pointer hovers over the widget. This is a utility function that creates a cursor via [ctor@Gdk.Cursor.new_from_name] and then sets it on @widget with [method@Gtk.Widget.set_cursor]. See those functions for details. On top of that, this function allows @name to be `NULL`, which will do the same as calling [method@Gtk.Widget.set_cursor] with a `NULL` cursor.

	- **@p** `name` is the name of the cursor.
	- **@r** `None.` 


- **set\_direction** (`string dir`)

	> Sets the reading direction on the widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction prevail, except for widgets where the children are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification). If the direction is set to [enum@Gtk.TextDirection.none], then the value set by [func@Gtk.Widget.set_default_direction] will be used.

	- **@p** `dir` is the new direction.
	- **@r** `None.` 


- **set\_focus\_child** (`object child`)

	> Set the focus child of the widget. This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call [method@Gtk.Widget.grab_focus] on it.

	- **@p** `child` is a direct child widget of @widget or `NULL` to unset the focus child.
	- **@r** `None.` 


- **set\_focus\_on\_click** (`bool focus_on_click`)

	> Sets whether the widget should grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

	- **@p** `focus_on_click` is whether the widget should grab focus when clicked with the mouse.
	- **@r** `None.` 


- **set\_focusable** (`bool focusable`)

	> Sets whether the widget can own the input focus. Widget implementations should set @focusable to true in their init() function if they want to receive keyboard input. Note that having @focusable be true is only one of the necessary conditions for being focusable. A widget must also be sensitive and can-focus and not have an ancestor that is marked as not can-focus in order to receive input focus. See [method@Gtk.Widget.grab_focus] for actually setting the input focus on a widget.

	- **@p** `focusable` is whether or not @widget can own the input focus.
	- **@r** `None.` 


- **set\_font\_map** (`object font_map`)

	> Sets the font map to use for text rendering in the widget. The font map is the object that is used to look up fonts. Setting a custom font map can be useful in special situations, e.g. when you need to add application-specific fonts to the set of available fonts. When not set, the widget will inherit the font map from its parent.

	- **@p** `font_map` is a `PangoFontMap`.
	- **@r** `None.` 


- **set\_font\_options** (`object options`)

	> Sets the `cairo_font_options_t` used for text rendering in the widget. When not set, the default font options for the `GdkDisplay` will be used.

	- **@p** `options` is a `cairo_font_options_t` struct to unset any previously set default font options.
	- **@r** `None.` 


- **set\_halign** (`string align`)

	> Sets the horizontal alignment of the widget.

	- **@p** `align` is the horizontal alignment.
	- **@r** `None.` 


- **set\_has\_tooltip** (`bool has_tooltip`)

	> Sets the `has-tooltip` property on the widget.

	- **@p** `has_tooltip` is whether or not @widget has a tooltip.
	- **@r** `None.` 


- **set\_hexpand** (`bool expand`)

	> Sets whether the widget would like any available extra horizontal space. When a user resizes a window, widgets with expand set to true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand. Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room. By default, widgets automatically expand if any of their children want to expand. (To see if a widget will automatically expand given its current children and state, call [method@Gtk.Widget.compute_expand]. A widget can decide how the expandability of children affects its own expansion by overriding the `compute_expand` virtual method on `GtkWidget`.). Setting hexpand explicitly with this function will override the automatic expand behavior. This function forces the widget to expand or not to expand, regardless of children. The override occurs because [method@Gtk.Widget.set_hexpand] sets the hexpand-set property (see [method@Gtk.Widget.set_hexpand_set]) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.

	- **@p** `expand` is whether to expand.
	- **@r** `None.` 


- **set\_hexpand\_set** (`bool set`)

	> Sets whether the hexpand flag will be used. The [property@Gtk.Widget:hexpand-set] property will be set automatically when you call [method@Gtk.Widget.set_hexpand] to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag. If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand. There are few reasons to use this function, but it’s here for completeness and consistency.

	- **@p** `set` is value for hexpand-set property.
	- **@r** `None.` 


- **set\_layout\_manager** (`object layout_manager`)

	> Sets the layout manager to use for measuring and allocating children of the widget.

	- **@p** `layout_manager` is a layout manager.
	- **@r** `None.` 


- **set\_limit\_events** (`bool limit_events`)

	> Sets whether the widget acts like a modal dialog, with respect to event delivery.

	- **@p** `limit_events` is whether to limit events.
	- **@r** `None.` 


- **set\_margin\_bottom** (`int margin`)

	> Sets the bottom margin of the widget.

	- **@p** `margin` is the bottom margin.
	- **@r** `None.` 


- **set\_margin\_end** (`int margin`)

	> Sets the end margin of the widget.

	- **@p** `margin` is the end margin.
	- **@r** `None.` 


- **set\_margin\_start** (`int margin`)

	> Sets the start margin of the widget.

	- **@p** `margin` is the start margin.
	- **@r** `None.` 


- **set\_margin\_top** (`int margin`)

	> Sets the top margin of the widget.

	- **@p** `margin` is the top margin.
	- **@r** `None.` 


- **set\_name** (`string name`)

	> Sets a widgets name. Setting a name allows you to refer to the widget from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for [class@Gtk.StyleContext]. Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *...), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.

	- **@p** `name` is name for the widget.
	- **@r** `None.` 


- **set\_opacity** (`double opacity`)

	> Requests the widget to be rendered partially transparent. An opacity of 0 is fully transparent and an opacity of 1 is fully opaque. Opacity works on both toplevel widgets and child widgets, although there are some limitations: For toplevel widgets, applying opacity depends on the capabilities of the windowing system. On X11, this has any effect only on X displays with a compositing manager, see [method@Gdk.Display.is_composited]. On Windows and Wayland it will always work, although setting a window’s opacity after the window has been shown may cause some flicker. Note that the opacity is inherited through inclusion — if you set a toplevel to be partially translucent, all of its content will appear translucent, since it is ultimatively rendered on that toplevel. The opacity value itself is not inherited by child widgets (since that would make widgets deeper in the hierarchy progressively more translucent). As a consequence, [class@Gtk.Popover] instances and other [iface@Gtk.Native] widgets with their own surface will use their own opacity value, and thus by default appear non-translucent, even if they are attached to a toplevel that is translucent.

	- **@p** `opacity` is desired opacity, between 0 and 1.
	- **@r** `None.` 


- **set\_overflow** (`string overflow`)

	> Sets how the widget treats content that is drawn outside the it's content area. See the definition of [enum@Gtk.Overflow] for details. This setting is provided for widget implementations and should not be used by application code. The default value is [enum@Gtk.Overflow.visible].

	- **@p** `overflow` is desired overflow value.
	- **@r** `None.` 


- **set\_parent** (`object parent`)

	> Sets the parent widget of the widget. This takes care of details such as updating the state and style of the child to reflect its new location and resizing the parent. The opposite function is [method@Gtk.Widget.unparent]. This function is useful only when implementing subclasses of `GtkWidget`.

	- **@p** `parent` is parent widget.
	- **@r** `None.` 


- **set\_receives\_default** (`bool receives_default`)

	> Sets whether the widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

	- **@p** `receives_default` is whether or not @widget can be a default widget.
	- **@r** `None.` 


- **set\_sensitive** (`bool sensitive`)

	> Sets the sensitivity of the widget. A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.

	- **@p** `sensitive` is true to make the widget sensitive.
	- **@r** `None.` 


- **set\_size\_request** (`int width, int height`)

	> Sets the minimum size of the widget. That is, the widget’s size request will be at least @width by @height. You can use this function to force a widget to be larger than it normally would be. In most cases, [method@Gtk.Window.set_default_size] is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it is basically impossible to hardcode a size that will always work. The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested. If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead. The size request set here does not include any margin from the properties [property@Gtk.Widget:margin-start], [property@Gtk.Widget:margin-end], [property@Gtk.Widget:margin-top], and [property@Gtk.Widget:margin-bottom], but it does include pretty much all other padding or border properties set by any subclass of `GtkWidget`.

	- **@p** `width` is width @widget should request, or -1 to unset.
	- **@p** `height` is height @widget should request, or -1 to unset.
	- **@r** `None.` 


- **set\_state\_flags** (`string flags, bool clear`)

	> Turns on flag values in the current widget state. Typical widget states are insensitive, prelighted, etc. This function accepts the values [flags@Gtk.StateFlags.dir-ltr] and [flags@Gtk.StateFlags.dir-rtl] but ignores them. If you want to set the widget's direction, use [method@Gtk.Widget.set_direction]. This function is for use in widget implementations.

	- **@p** `flags` is state flags to turn on.
	- **@p** `clear` is whether to clear state before turning on @flags.
	- **@r** `None.` 


- **set\_tooltip\_markup** (`string markup`)

	> Sets the contents of the tooltip for widget. @markup must contain Pango markup. This function will take care of setting the [property@Gtk.Widget:has-tooltip] as a side effect, and of the default handler for the [signal@Gtk.Widget::query-tooltip] signal. See also [method@Gtk.Tooltip.set_markup].

	- **@p** `markup` is the contents of the tooltip for @widget.
	- **@r** `None.` 


- **set\_tooltip\_text** (`string text`)

	> Sets the contents of the tooltip for the widget. If @text contains any markup, it will be escaped. This function will take care of setting [property@Gtk.Widget:has-tooltip] as a side effect, and of the default handler for the [signal@Gtk.Widget::query-tooltip] signal. See also [method@Gtk.Tooltip.set_text].

	- **@p** `text` is the contents of the tooltip for @widget.
	- **@r** `None.` 


- **set\_valign** (`string align`)

	> Sets the vertical alignment of the widget.

	- **@p** `align` is the vertical alignment.
	- **@r** `None.` 


- **set\_vexpand** (`bool expand`)

	> Sets whether the widget would like any available extra vertical space. See [method@Gtk.Widget.set_hexpand] for more detail.

	- **@p** `expand` is whether to expand.
	- **@r** `None.` 


- **set\_vexpand\_set** (`bool set`)

	> Sets whether the vexpand flag will be used. See [method@Gtk.Widget.set_hexpand_set] for more detail.

	- **@p** `set` is value for vexpand-set property.
	- **@r** `None.` 


- **set\_visible** (`bool visible`)

	> Sets the visibility state of @widget. Note that setting this to true doesn’t mean the widget is actually viewable, see [method@Gtk.Widget.get_visible].

	- **@p** `visible` is whether the widget should be shown or not.
	- **@r** `None.` 


- **should\_layout** ()

	> Returns whether the widget should contribute to the measuring and allocation of its parent. This is false for invisible children, but also for children that have their own surface, such as [class@Gtk.Popover] instances.



- **show** ()

	> Flags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen. When a toplevel widget is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel widget is realized and mapped.

	- **@r** `None.` 


- **snapshot\_child** (`object child, object snapshot`)

	> Snapshots a child of the widget. When a widget receives a call to the snapshot function, it must send synthetic [vfunc@Gtk.Widget.snapshot] calls to all children. This function provides a convenient way of doing this. A widget, when it receives a call to its [vfunc@Gtk.Widget.snapshot] function, calls gtk_widget_snapshot_child() once for each child, passing in the @snapshot the widget received. This function takes care of translating the origin of @snapshot, and deciding whether the child needs to be snapshot. It does nothing for children that implement `GtkNative`.

	- **@p** `child` is a child of @widget.
	- **@p** `snapshot` is snapshot as passed to the widget. In particular, no calls to [method@Gtk.Snapshot.translate] or other transform calls should have been made.
	- **@r** `None.` 


- **trigger\_tooltip\_query** ()

	> Triggers a tooltip query on the display of the widget.

	- **@r** `None.` 


- **unmap** ()

	> Causes a widget to be unmapped if it’s currently mapped. This function is only for use in widget implementations.

	- **@r** `None.` 


- **unparent** ()

	> Removes @widget from its parent. This function is only for use in widget implementations, typically in dispose.

	- **@r** `None.` 


- **unrealize** ()

	> Causes a widget to be unrealized. This frees all GDK resources associated with the widget. This function is only useful in widget implementations.

	- **@r** `None.` 


- **unset\_state\_flags** (`string flags`)

	> Turns off flag values for the current widget state. See [method@Gtk.Widget.set_state_flags]. This function is for use in widget implementations.

	- **@p** `flags` is state flags to turn off.
	- **@r** `None.` 


- **mnemonic\_labels** ()

	> Returns `list_mnemonic_labels` as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use `list_mnemonic_labels()` when lazy or change-notify access is required.

	- **@r** `An` Aussom list of elements.


- **children** ()

	> Returns `observe_children` as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use `observe_children()` when lazy or change-notify access is required.

	- **@r** `An` Aussom list of elements.


- **controllers** ()

	> Returns `observe_controllers` as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use `observe_controllers()` when lazy or change-notify access is required.

	- **@r** `An` Aussom list of elements.




## class: WidgetDestroyCallback

[3135:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `destroy`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetDestroyCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetRealizeCallback

[3701:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `realize`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetRealizeCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetHideCallback

[3276:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `hide`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetHideCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetMapCallback

[3417:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `map`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetMapCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetMovefocusCallback

[3558:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `move-focus`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetMovefocusCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, direction, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetUnrealizeCallback

[3982:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `unrealize`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetUnrealizeCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetShowCallback

[3771:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `show`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetShowCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetUnmapCallback

[3912:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `unmap`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetUnmapCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetMeta

[4052:14] `static` **extends: object** 

Generated metadata helpers for `Widget` class surfaces.

#### Methods

- **properties** ()

	> Returns property metadata for `Widget`.

	- **@r** `A` list.


- **signals** ()

	> Returns signal metadata for `Widget`.

	- **@r** `A` list.




## class: WidgetQuerytooltipCallback

[3629:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `query-tooltip`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetQuerytooltipCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, x, y, keyboard_mode, tooltip, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetDirectionchangedCallback

[3205:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `direction-changed`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetDirectionchangedCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, previous_direction, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetMnemonicactivateCallback

[3487:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `mnemonic-activate`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetMnemonicactivateCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, group_cycling, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetStateflagschangedCallback

[3841:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `state-flags-changed`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetStateflagschangedCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, flags, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: WidgetKeynavfailedCallback

[3346:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `keynav-failed`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **WidgetKeynavfailedCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, direction, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.