Skip to main content

Type Alias: WidgetProps

WidgetProps = object

Defined in: generated/jsx.ts:16

Base props shared by all GTK widget elements.

Properties

accessibleRole?

optional accessibleRole: Gtk.AccessibleRole

Defined in: generated/jsx.ts:180

The accessible role of the given GtkAccessible implementation.

The accessible role cannot be changed once set.


canFocus?

optional canFocus: boolean

Defined in: generated/jsx.ts:24

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.


canTarget?

optional canTarget: boolean

Defined in: generated/jsx.ts:26

Whether the widget can receive pointer events.


children?

optional children: ReactNode

Defined in: generated/jsx.ts:309

Children elements. For container widgets, these are child widgets. For non-container widgets, these are event controller elements.


cssClasses?

optional cssClasses: string[]

Defined in: generated/jsx.ts:28

A list of css classes applied to this widget.


cursor?

optional cursor: Gdk.Cursor | null

Defined in: generated/jsx.ts:30

The cursor used by widget.


focusable?

optional focusable: boolean

Defined in: generated/jsx.ts:38

Whether this widget itself will accept the input focus.


focusOnClick?

optional focusOnClick: boolean

Defined in: generated/jsx.ts:36

Whether the widget should grab focus when it is clicked with the mouse.

This property is only relevant for widgets that can take focus.


grabFocus?

optional grabFocus: boolean

Defined in: generated/jsx.ts:307

When set to true, the widget will grab focus. Useful for focusing a widget when a condition becomes true.


halign?

optional halign: Gtk.Align

Defined in: generated/jsx.ts:40

How to distribute horizontal space if widget gets extra space.


hasTooltip?

optional hasTooltip: boolean

Defined in: generated/jsx.ts:49

Enables or disables the emission of the 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 Widget.:query-tooltip to determine whether it will provide a tooltip or not.


heightRequest?

optional heightRequest: number

Defined in: generated/jsx.ts:55

Overrides for height request of the widget.

If this is -1, the natural request will be used.


hexpand?

optional hexpand: boolean

Defined in: generated/jsx.ts:57

Whether to expand horizontally.


hexpandSet?

optional hexpandSet: boolean

Defined in: generated/jsx.ts:59

Whether to use the hexpand property.


layoutManager?

optional layoutManager: Gtk.LayoutManager | null

Defined in: generated/jsx.ts:67

The 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.


limitEvents?

optional limitEvents: boolean

Defined in: generated/jsx.ts:76

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 EventController.set_propagation_limit.


marginBottom?

optional marginBottom: number

Defined in: generated/jsx.ts:84

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 Widget.set_size_request for example.


marginEnd?

optional marginEnd: number

Defined in: generated/jsx.ts:95

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 Widget.set_size_request for example.


marginStart?

optional marginStart: number

Defined in: generated/jsx.ts:106

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 Widget.set_size_request for example.


marginTop?

optional marginTop: number

Defined in: generated/jsx.ts:114

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 Widget.set_size_request for example.


name?

optional name: string

Defined in: generated/jsx.ts:116

The name of the widget.


onDestroy?

optional onDestroy: (self) => void | null

Defined in: generated/jsx.ts:189

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.


onDirectionChanged?

optional onDirectionChanged: (previousDirection, self) => void | null

Defined in: generated/jsx.ts:191

Emitted when the text direction of a widget changes.


onHide?

optional onHide: (self) => void | null

Defined in: generated/jsx.ts:193

Emitted when widget is hidden.


onKeynavFailed?

optional onKeynavFailed: (direction, self) => boolean | null

Defined in: generated/jsx.ts:199

Emitted if keyboard navigation fails.

See Widget.keynav_failed for details.


onMap?

optional onMap: (self) => void | null

Defined in: generated/jsx.ts:211

Emitted when widget is going to be mapped.

A widget is mapped when the widget is visible (which is controlled with 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 Widget.:unmap.


onMnemonicActivate?

optional onMnemonicActivate: (groupCycling, self) => boolean | null

Defined in: generated/jsx.ts:218

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.


onMoveFocus?

optional onMoveFocus: (direction, self) => void | null

Defined in: generated/jsx.ts:227

Emitted when the focus is moved.

The ::move-focus signal is a keybinding signal.

The default bindings for this signal are Tab to move forward, and Shift+Tab to move backward.


onNotify?

optional onNotify: (pspec, self) => void | null

Defined in: generated/jsx.ts:305

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with %G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in ::notify being emitted, even if the new value is the same as the old. If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

|[ g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view) ]|

It is important to note that you must use [canonical parameter names]GObjectParamSpec#parameter-names as detail strings for the notify signal.


onQueryTooltip?

optional onQueryTooltip: (x, y, keyboardMode, tooltip, self) => boolean | null

Defined in: generated/jsx.ts:243

Emitted when the widget’s tooltip is about to be shown.

This happens when the 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.


onRealize?

optional onRealize: (self) => void | null

Defined in: generated/jsx.ts:252

Emitted when widget is associated with a GdkSurface.

This means that Widget.realize has been called or the widget has been mapped (that is, it is going to be drawn).


onShow?

optional onShow: (self) => void | null

Defined in: generated/jsx.ts:254

Emitted when widget is shown.


onStateFlagsChanged?

optional onStateFlagsChanged: (flags, self) => void | null

Defined in: generated/jsx.ts:260

Emitted when the widget state changes.

See Widget.get_state_flags.


onUnmap?

optional onUnmap: (self) => void | null

Defined in: generated/jsx.ts:270

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.


onUnrealize?

optional onUnrealize: (self) => void | null

Defined in: generated/jsx.ts:277

Emitted when the GdkSurface associated with widget is destroyed.

This means that Widget.unrealize has been called or the widget has been unmapped (that is, it is going to be hidden).


opacity?

optional opacity: number

Defined in: generated/jsx.ts:118

The requested opacity of the widget.


overflow?

optional overflow: Gtk.Overflow

Defined in: generated/jsx.ts:125

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.


receivesDefault?

optional receivesDefault: boolean

Defined in: generated/jsx.ts:127

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


sensitive?

optional sensitive: boolean

Defined in: generated/jsx.ts:129

Whether the widget responds to input.


tooltipMarkup?

optional tooltipMarkup: string | null

Defined in: generated/jsx.ts:145

Sets the text of tooltip to be the given string, which is marked up with Pango markup.

Also see Tooltip.set_markup.

This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: Widget.has-tooltip will automatically be set to true and there will be taken care of Widget.:query-tooltip in the default signal handler.

Note that if both Widget.tooltip-text and Widget.tooltip-markup are set, the last one wins.


tooltipText?

optional tooltipText: string | null

Defined in: generated/jsx.ts:160

Sets the text of tooltip to be the given string.

Also see Tooltip.set_text.

This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: Widget.has-tooltip will automatically be set to true and there will be taken care of Widget.:query-tooltip in the default signal handler.

Note that if both Widget.tooltip-text and Widget.tooltip-markup are set, the last one wins.


valign?

optional valign: Gtk.Align

Defined in: generated/jsx.ts:162

How to distribute vertical space if widget gets extra space.


vexpand?

optional vexpand: boolean

Defined in: generated/jsx.ts:164

Whether to expand vertically.


vexpandSet?

optional vexpandSet: boolean

Defined in: generated/jsx.ts:166

Whether to use the vexpand property.


visible?

optional visible: boolean

Defined in: generated/jsx.ts:168

Whether the widget is visible.


widthRequest?

optional widthRequest: number

Defined in: generated/jsx.ts:174

Overrides for width request of the widget.

If this is -1, the natural request will be used.