SpinButton

open class SpinButton(pointer: <Error class: unknown class><<Error class: unknown class>>) : Widget, AccessibleRange, CellEditable, Editable, Orientable

A GtkSpinButton is an ideal way to allow the user to set the value of some attribute.

An example GtkSpinButton

Rather than having to directly type a number into a GtkEntry, GtkSpinButton allows the user to click on one of two arrows to increment or decrement the displayed value. A value can still be typed in, with the bonus that it can be checked to ensure it is in a given range.

The main properties of a GtkSpinButton are through an adjustment. See the class@Gtk.Adjustment documentation for more details about an adjustment's properties.

Note that GtkSpinButton will by default make its entry large enough to accommodate the lower and upper bounds of the adjustment. If this is not desired, the automatic sizing can be turned off by explicitly setting property@Gtk.Editable:width-chars to a value != -1.

Using a GtkSpinButton to get an integer

// Provides a function to retrieve an integer value from a GtkSpinButton
// and creates a spin button to model percentage values.

int
grab_int_value (GtkSpinButton *button,
gpointer user_data)
{
return gtk_spin_button_get_value_as_int (button);
}

void
create_integer_spin_button (void)
{

GtkWidget *window, *button;
GtkAdjustment *adjustment;

adjustment = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 0.0);

window = gtk_window_new ();

// creates the spinbutton, with no decimal places
button = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_window_set_child (GTK_WINDOW (window), button);

gtk_window_present (GTK_WINDOW (window));
}

Using a GtkSpinButton to get a floating point value

// Provides a function to retrieve a floating point value from a
// GtkSpinButton, and creates a high precision spin button.

float
grab_float_value (GtkSpinButton *button,
gpointer user_data)
{
return gtk_spin_button_get_value (button);
}

void
create_floating_spin_button (void)
{
GtkWidget *window, *button;
GtkAdjustment *adjustment;

adjustment = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.0);

window = gtk_window_new ();

// creates the spinbutton, with three decimal places
button = gtk_spin_button_new (adjustment, 0.001, 3);
gtk_window_set_child (GTK_WINDOW (window), button);

gtk_window_present (GTK_WINDOW (window));
}

Shortcuts and Gestures

The following signals have default keybindings:

  • signal@Gtk.SpinButton::change-value

CSS nodes

spinbutton.horizontal
├── text
│ ├── undershoot.left
│ ╰── undershoot.right
├── button.down
╰── button.up
spinbutton.vertical
├── button.up
├── text
│ ├── undershoot.left
│ ╰── undershoot.right
╰── button.down

GtkSpinButtons main CSS node has the name spinbutton. It creates subnodes for the entry and the two buttons, with these names. The button nodes have the style classes .up and .down. The GtkText subnodes (if present) are put below the text node. The orientation of the spin button is reflected in the .vertical or .horizontal style class on the main node.

Accessibility

GtkSpinButton uses the %GTK_ACCESSIBLE_ROLE_SPIN_BUTTON role.

Skipped during bindings generation

  • parameter step: step: Out parameter is not supported

  • parameter min: min: Out parameter is not supported

  • signal input: Unsupported parameter new_value : new_value: Out parameter is not supported

Constructors

Link copied to clipboard
constructor(adjustment: Adjustment? = null, climbRate: <Error class: unknown class>, digits: <Error class: unknown class>)

Creates a new GtkSpinButton.

constructor(min: <Error class: unknown class>, max: <Error class: unknown class>, step: <Error class: unknown class>)

Creates a new GtkSpinButton with the given properties.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The accessible role of the given GtkAccessible implementation.

Link copied to clipboard

Whether to activate the default widget when the spin button is activated.

Link copied to clipboard

The adjustment that holds the value of the spin button.

Link copied to clipboard
open var canFocus: Boolean

Whether the widget or any of its descendents can accept the input focus.

Link copied to clipboard
open var canTarget: Boolean

Whether the widget can receive pointer events.

Link copied to clipboard
open var climbRate: <Error class: unknown class>

The acceleration rate when you hold down a button or key.

Link copied to clipboard

A list of css classes applied to this widget.

Link copied to clipboard
open val cssName: String

The name of this widget in the CSS tree.

Link copied to clipboard
open var cursor: <Error class: unknown class>?

The cursor used by @widget.

Link copied to clipboard
open var cursorPosition: <Error class: unknown class>

The current position of the insertion cursor in chars.

Link copied to clipboard
open var digits: <Error class: unknown class>

The number of decimal places to display.

Link copied to clipboard
open var editable: Boolean

Whether the entry contents can be edited.

Link copied to clipboard

If undo/redo should be enabled for the editable.

Link copied to clipboard
open var focusable: Boolean

Whether this widget itself will accept the input focus.

Link copied to clipboard

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

Link copied to clipboard
open override val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkAccessibleRangePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkCellEditablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkEditablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkOrientablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkSpinButtonPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkWidgetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var halign: Align

How to distribute horizontal space if widget gets extra space.

Link copied to clipboard

Enables or disables the emission of the ::query-tooltip signal on @widget.

Link copied to clipboard
open var hexpand: Boolean

Whether to expand horizontally.

Link copied to clipboard

Whether to use the hexpand property.

Link copied to clipboard

The GtkLayoutManager instance to use to compute the preferred size of the widget, and allocate its children.

Link copied to clipboard
open var marginBottom: <Error class: unknown class>

Margin on bottom side of widget.

Link copied to clipboard
open var marginEnd: <Error class: unknown class>

Margin on end of widget, horizontally.

Link copied to clipboard
open var marginStart: <Error class: unknown class>

Margin on start of widget, horizontally.

Link copied to clipboard
open var marginTop: <Error class: unknown class>

Margin on top side of widget.

Link copied to clipboard
open var maxWidthChars: <Error class: unknown class>

The desired maximum width of the entry, in characters.

Link copied to clipboard
open var name: String

The name of the widget.

Link copied to clipboard
open var numeric: Boolean

Whether non-numeric characters should be ignored.

Link copied to clipboard
open var opacity: <Error class: unknown class>

The requested opacity of the widget.

Link copied to clipboard

The orientation of the orientable.

Link copied to clipboard
open var overflow: Overflow

How content outside the widget's content area is treated.

Link copied to clipboard
open val parent: Widget?

The parent widget of this widget.

Link copied to clipboard

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

Link copied to clipboard
open val root: Root?

The GtkRoot widget of the widget tree containing this widget.

Link copied to clipboard
open val scaleFactor: <Error class: unknown class>

The scale factor of the widget.

Link copied to clipboard

Whether erroneous values are automatically changed to the spin buttons nearest step increment.

Link copied to clipboard
open var text: String

The contents of the entry.

Link copied to clipboard

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

Link copied to clipboard
open var tooltipText: String?

Sets the text of tooltip to be the given string.

Link copied to clipboard

Whether the spin button should update always, or only when the value is acceptable.

Link copied to clipboard
open var valign: Align

How to distribute vertical space if widget gets extra space.

Link copied to clipboard
open var value: <Error class: unknown class>

The current value.

Link copied to clipboard
open var vexpand: Boolean

Whether to expand vertically.

Link copied to clipboard

Whether to use the vexpand property.

Link copied to clipboard
open var widthChars: <Error class: unknown class>

Number of characters to leave space for in the entry.

Link copied to clipboard
open var wrap: Boolean

Whether a spin button should wrap upon reaching its limits.

Link copied to clipboard
open var xalign: <Error class: unknown class>

The horizontal alignment, from 0 (left) to 1 (right).

Functions

Link copied to clipboard
open fun actionSetEnabled(actionName: String, enabled: Boolean)

Enable or disable an action installed with gtk_widget_class_install_action().

Link copied to clipboard
open fun activateActionIfExists(name: String, args: <Error class: unknown class>? = null): Boolean

Looks up the action in the action groups associated with

Link copied to clipboard
open fun activateDefault()

Activates the default.activate action from @widget.

Link copied to clipboard

For widgets that can be “activated” (buttons, menu items, etc.), this function activates them.

Link copied to clipboard
open fun addController(controller: EventController)

Adds @controller to @widget so that it will receive events.

Link copied to clipboard
open fun addCssClass(cssClass: String)

Adds a style class to @widget.

Link copied to clipboard
open fun addMnemonicLabel(label: Widget)

Adds a widget to the list of mnemonic labels for this widget.

Link copied to clipboard
open fun addTickCallback(callback: TickCallback): <Error class: unknown class>

Queues an animation frame update and adds a callback to be called before each frame.

Link copied to clipboard
open fun allocate(width: <Error class: unknown class>, height: <Error class: unknown class>, baseline: <Error class: unknown class>, transform: <Error class: unknown class>? = null)

This function is only used by GtkWidget subclasses, to assign a size, position and (optionally) baseline to their child widgets.

Link copied to clipboard
open fun announce(message: String, priority: AccessibleAnnouncementPriority)

Requests the user's screen reader to announce the given message.

Link copied to clipboard
open fun childFocus(direction: DirectionType): Boolean

Called by widgets as the user moves around the window using keyboard shortcuts.

Link copied to clipboard
open fun computeBounds(target: Widget, outBounds: <Error class: unknown class>): Boolean

Computes the bounds for @widget in the coordinate space of @target.

Link copied to clipboard
open fun computeExpand(orientation: Orientation): Boolean

Computes whether a container should give this widget extra space when possible.

Link copied to clipboard
open fun computePoint(target: Widget, point: <Error class: unknown class>, outPoint: <Error class: unknown class>): Boolean

Translates the given @point in @widget's coordinates to coordinates relative to @target’s coordinate system.

Link copied to clipboard
open fun computeTransform(target: Widget, outTransform: <Error class: unknown class>): Boolean

Computes a matrix suitable to describe a transformation from

Link copied to clipboard
open fun configure(adjustment: Adjustment? = null, climbRate: <Error class: unknown class>, digits: <Error class: unknown class>)

Changes the properties of an existing spin button.

Link copied to clipboard
fun connectActivate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the spin button is activated.

Link copied to clipboard
open fun connectChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted at the end of a single user-visible operation on the contents.

Link copied to clipboard
fun connectChangeValue(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (scroll: ScrollType) -> Unit): <Error class: unknown class>

Emitted when the user initiates a value change.

Link copied to clipboard
open fun connectDeleteText(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Unit): <Error class: unknown class>

Emitted when text is deleted from the widget by the user.

Link copied to clipboard
fun connectDestroy(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Signals that all holders of a reference to the widget should release the reference that they hold.

Link copied to clipboard
fun connectDirectionChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (previousDirection: TextDirection) -> Unit): <Error class: unknown class>

Emitted when the text direction of a widget changes.

Link copied to clipboard
open fun connectEditingDone(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

This signal is a sign for the cell renderer to update its value from the @cell_editable.

Link copied to clipboard
fun connectHide(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when @widget is hidden.

Link copied to clipboard
fun connectKeynavFailed(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (direction: DirectionType) -> Boolean): <Error class: unknown class>

Emitted if keyboard navigation fails.

Link copied to clipboard
fun connectMap(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when @widget is going to be mapped.

Link copied to clipboard
fun connectMnemonicActivate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (groupCycling: Boolean) -> Boolean): <Error class: unknown class>

Emitted when a widget is activated via a mnemonic.

Link copied to clipboard
fun connectMoveFocus(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (direction: DirectionType) -> Unit): <Error class: unknown class>

Emitted when the focus is moved.

Link copied to clipboard
fun connectOutput(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Boolean): <Error class: unknown class>

Emitted to tweak the formatting of the value for display.

Link copied to clipboard
fun connectQueryTooltip(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>, keyboardMode: Boolean, tooltip: Tooltip) -> Boolean): <Error class: unknown class>

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

Link copied to clipboard
fun connectRealize(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when @widget is associated with a GdkSurface.

Link copied to clipboard
open fun connectRemoveWidget(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

This signal is meant to indicate that the cell is finished editing, and the @cell_editable widget is being removed and may subsequently be destroyed.

Link copied to clipboard
fun connectShow(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when @widget is shown.

Link copied to clipboard
fun connectStateFlagsChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (flags: StateFlags) -> Unit): <Error class: unknown class>

Emitted when the widget state changes.

Link copied to clipboard
fun connectUnmap(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when @widget is going to be unmapped.

Link copied to clipboard
fun connectUnrealize(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the GdkSurface associated with @widget is destroyed.

Link copied to clipboard
fun connectValueChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the value is changed.

Link copied to clipboard
fun connectWrapped(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted right after the spinbutton wraps from its maximum to its minimum value or vice-versa.

Link copied to clipboard
open fun contains(x: <Error class: unknown class>, y: <Error class: unknown class>): Boolean

Tests if the point at (@x, @y) is contained in @widget.

Link copied to clipboard
open fun createPangoContext(): <Error class: unknown class>

Creates a new PangoContext with the appropriate font map, font options, font description, and base direction for drawing text for this widget.

Link copied to clipboard
open fun createPangoLayout(text: String? = null): <Error class: unknown class>

Creates a new PangoLayout with the appropriate font map, font description, and base direction for drawing text for this widget.

Link copied to clipboard

Retrieves the accessible platform state from the editable delegate.

Link copied to clipboard
open fun deleteSelection()

Deletes the currently selected text of the editable.

Link copied to clipboard
open fun deleteText(startPos: <Error class: unknown class>, endPos: <Error class: unknown class>)

Deletes a sequence of characters.

Link copied to clipboard
open fun disposeTemplate(widgetType: <Error class: unknown class>)

Clears the template children for the given widget.

Link copied to clipboard
open fun dragCheckThreshold(startX: <Error class: unknown class>, startY: <Error class: unknown class>, currentX: <Error class: unknown class>, currentY: <Error class: unknown class>): Boolean

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

Link copied to clipboard
open fun editingDone()

Emits the GtkCellEditable::editing-done signal.

Link copied to clipboard
open fun errorBell()

Notifies the user about an input-related error on this widget.

Link copied to clipboard
open fun finishDelegate()

Undoes the setup done by method@Gtk.Editable.init_delegate.

Link copied to clipboard

Retrieves the accessible parent for an accessible object.

Link copied to clipboard

Retrieves the accessible role of an accessible object.

Link copied to clipboard
open fun getAlignment(): <Error class: unknown class>

Gets the alignment of the editable.

Link copied to clipboard
open fun getAllocatedBaseline(): <Error class: unknown class>

Returns the baseline that has currently been allocated to @widget.

Link copied to clipboard
open fun getAllocatedHeight(): <Error class: unknown class>

Returns the height that has currently been allocated to @widget.

Link copied to clipboard
open fun getAllocatedWidth(): <Error class: unknown class>

Returns the width that has currently been allocated to @widget.

Link copied to clipboard
open fun getAncestor(widgetType: <Error class: unknown class>): Widget?

Gets the first ancestor of @widget with type @widget_type.

Link copied to clipboard

Retrieves the accessible implementation for the given GtkAccessible.

Link copied to clipboard
open fun getBaseline(): <Error class: unknown class>

Returns the baseline that has currently been allocated to @widget.

Link copied to clipboard
open fun getBuildableId(): String?

Gets the ID of the @buildable object.

Link copied to clipboard
open fun getChars(startPos: <Error class: unknown class>, endPos: <Error class: unknown class>): String

Retrieves a sequence of characters.

Link copied to clipboard

Gets the value set with gtk_widget_set_child_visible().

Link copied to clipboard
open fun getClipboard(): <Error class: unknown class>

Gets the clipboard object for @widget.

Link copied to clipboard
open fun getColor(color: <Error class: unknown class>)

Gets the current foreground color for the widget’s CSS style.

Link copied to clipboard
open fun getDelegate(): Editable?

Gets the GtkEditable that @editable is delegating its implementation to.

Link copied to clipboard

Gets the reading direction for a particular widget.

Link copied to clipboard
open fun getDisplay(): <Error class: unknown class>

Get the GdkDisplay for the toplevel window associated with this widget.

Link copied to clipboard
open fun getEditable(): Boolean

Retrieves whether @editable is editable.

Link copied to clipboard

Gets if undo/redo actions are enabled for @editable

Link copied to clipboard

Retrieves the first accessible child of an accessible object.

Link copied to clipboard
open fun getFirstChild(): Widget?

Returns the widget’s first child.

Link copied to clipboard
open fun getFocusChild(): Widget?

Returns the current focus child of @widget.

Link copied to clipboard
open fun getFontMap(): <Error class: unknown class>?

Gets the font map of @widget.

Link copied to clipboard
open fun getFrameClock(): <Error class: unknown class>?

Obtains the frame clock for a widget.

Link copied to clipboard
open fun getHeight(): <Error class: unknown class>

Returns the content height of the widget.

Link copied to clipboard
open fun getLastChild(): Widget?

Returns the widget’s last child.

Link copied to clipboard
open fun getMapped(): Boolean

Whether the widget is mapped.

Link copied to clipboard
open fun getMaxWidthChars(): <Error class: unknown class>

Retrieves the desired maximum width of @editable, in characters.

Link copied to clipboard
open fun getNative(): Native?

Returns the nearest GtkNative ancestor of @widget.

Link copied to clipboard

Retrieves the next accessible sibling of an accessible object

Link copied to clipboard
open fun getNextSibling(): Widget?

Returns the widget’s next sibling.

Link copied to clipboard

Retrieves the orientation of the @orientable.

Link copied to clipboard
open fun getPangoContext(): <Error class: unknown class>

Gets a PangoContext with the appropriate font map, font description, and base direction for this widget.

Link copied to clipboard

Query a platform state, such as focus.

Link copied to clipboard
open fun getPosition(): <Error class: unknown class>

Retrieves the current position of the cursor relative to the start of the content of the editable.

Link copied to clipboard
open fun getPreferredSize(minimumSize: Requisition?, naturalSize: Requisition?)

Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

Link copied to clipboard
open fun getPrevSibling(): Widget?

Returns the widget’s previous sibling.

Link copied to clipboard
open fun getPrimaryClipboard(): <Error class: unknown class>

Gets the primary clipboard of @widget.

Link copied to clipboard
open fun getRealized(): Boolean

Determines whether @widget is realized.

Link copied to clipboard

Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

Link copied to clipboard
open fun getSensitive(): Boolean

Returns the widget’s sensitivity.

Link copied to clipboard
open fun getSettings(): Settings

Gets the settings object holding the settings used for this widget.

Link copied to clipboard
open fun getSize(orientation: Orientation): <Error class: unknown class>

Returns the content width or height of the widget.

Link copied to clipboard

Returns the widget state as a flag set.

Link copied to clipboard

Returns the style context associated to @widget.

Link copied to clipboard
open fun getTemplateChild(widgetType: <Error class: unknown class>, name: String): <Error class: unknown class>

Fetch an object build from the template XML for @widget_type in this @widget instance.

Link copied to clipboard
open fun getText(): String

Retrieves the contents of @editable.

Link copied to clipboard
open fun getValueAsInt(): <Error class: unknown class>

Get the value @spin_button represented as an integer.

Link copied to clipboard
open fun getVisible(): Boolean

Determines whether the widget is visible.

Link copied to clipboard
open fun getWidth(): <Error class: unknown class>

Returns the content width of the widget.

Link copied to clipboard
open fun getWidthChars(): <Error class: unknown class>

Gets the number of characters of space reserved for the contents of the editable.

Link copied to clipboard
open fun grabFocus(): Boolean

Causes @widget to have the keyboard focus for the GtkWindow it's inside.

Link copied to clipboard
open fun hasCssClass(cssClass: String): Boolean

Returns whether @css_class is currently applied to @widget.

Link copied to clipboard
open fun hasDefault(): Boolean

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

Link copied to clipboard
open fun hasFocus(): Boolean

Determines if the widget has the global input focus.

Link copied to clipboard

Determines if the widget should show a visible indication that it has the global input focus.

Link copied to clipboard
open fun hide()

Reverses the effects of gtk_widget_show().

Link copied to clipboard

Returns whether the widget is currently being destroyed.

Link copied to clipboard
open fun initDelegate()

Sets up a delegate for GtkEditable.

Link copied to clipboard
open fun initTemplate()

Creates and initializes child widgets defined in templates.

Link copied to clipboard
open fun insertActionGroup(name: String, group: <Error class: unknown class>? = null)

Inserts @group into @widget.

Link copied to clipboard
open fun insertAfter(parent: Widget, previousSibling: Widget? = null)

Inserts @widget into the child widget list of @parent.

Link copied to clipboard
open fun insertBefore(parent: Widget, nextSibling: Widget? = null)

Inserts @widget into the child widget list of @parent.

Link copied to clipboard
open fun isAncestor(ancestor: Widget): Boolean

Determines whether @widget is somewhere inside @ancestor, possibly with intermediate containers.

Link copied to clipboard
open fun isDrawable(): Boolean

Determines whether @widget can be drawn to.

Link copied to clipboard
open fun isFocus(): Boolean

Determines if the widget is the focus widget within its toplevel.

Link copied to clipboard
open fun isSensitive(): Boolean

Returns the widget’s effective sensitivity.

Link copied to clipboard
open fun isVisible(): Boolean

Determines whether the widget and all its parents are marked as visible.

Link copied to clipboard
open fun keynavFailed(direction: DirectionType): Boolean

Emits the ::keynav-failed signal on the widget.

Link copied to clipboard
open fun listMnemonicLabels(): <Error class: unknown class>

Returns the widgets for which this widget is the target of a mnemonic.

Link copied to clipboard
open fun map()

Causes a widget to be mapped if it isn’t already.

Link copied to clipboard
open fun mnemonicActivate(groupCycling: Boolean): Boolean

Emits the ::mnemonic-activate signal.

Link copied to clipboard
open fun observeChildren(): <Error class: unknown class>

Returns a GListModel to track the children of @widget.

Link copied to clipboard
open fun observeControllers(): <Error class: unknown class>

Returns a GListModel to track the class@Gtk.EventControllers of @widget.

Link copied to clipboard
open fun pick(x: <Error class: unknown class>, y: <Error class: unknown class>, flags: PickFlags): Widget?

Finds the descendant of @widget closest to the point (@x, @y).

Link copied to clipboard
open fun queueAllocate()

Flags the widget for a rerun of the vfunc@Gtk.Widget.size_allocate function.

Link copied to clipboard
open fun queueDraw()

Schedules this widget to be redrawn in the paint phase of the current or the next frame.

Link copied to clipboard
open fun queueResize()

Flags a widget to have its size renegotiated.

Link copied to clipboard
open fun realize()

Creates the GDK resources associated with a widget.

Link copied to clipboard
open fun removeController(controller: EventController)

Removes @controller from @widget, so that it doesn't process events anymore.

Link copied to clipboard
open fun removeCssClass(cssClass: String)

Removes a style from @widget.

Link copied to clipboard
open fun removeMnemonicLabel(label: Widget)

Removes a widget from the list of mnemonic labels for this widget.

Link copied to clipboard
open fun removeTickCallback(id: <Error class: unknown class>)

Removes a tick callback previously registered with gtk_widget_add_tick_callback().

Link copied to clipboard
open fun removeWidget()

Emits the GtkCellEditable::remove-widget signal.

Link copied to clipboard
open fun resetProperty(property: AccessibleProperty)

Resets the accessible @property to its default value.

Link copied to clipboard
open fun resetRelation(relation: AccessibleRelation)

Resets the accessible @relation to its default value.

Link copied to clipboard
open fun resetState(state: AccessibleState)

Resets the accessible @state to its default value.

Link copied to clipboard
open fun selectRegion(startPos: <Error class: unknown class>, endPos: <Error class: unknown class>)

Selects a region of text.

Link copied to clipboard
open fun setAccessibleParent(parent: Accessible? = null, nextSibling: Accessible? = null)

Sets the parent and sibling of an accessible object.

Link copied to clipboard
open fun setAlignment(xalign: <Error class: unknown class>)

Sets the alignment for the contents of the editable.

Link copied to clipboard
open fun setChildVisible(childVisible: Boolean)

Sets whether @widget should be mapped along with its parent.

Link copied to clipboard
open fun setCursorFromName(name: String? = null)

Sets a named cursor to be shown when pointer devices point towards @widget.

Link copied to clipboard

Sets the reading direction on a particular widget.

Link copied to clipboard
open fun setEditable(isEditable: Boolean)

Determines if the user can edit the text in the editable widget.

Link copied to clipboard
open fun setEnableUndo(enableUndo: Boolean)

If enabled, changes to @editable will be saved for undo/redo actions.

Link copied to clipboard
open fun setFocusChild(child: Widget? = null)

Set @child as the current focus child of @widget.

Link copied to clipboard
open fun setFontMap(fontMap: <Error class: unknown class>? = null)

Sets the font map to use for Pango rendering.

Link copied to clipboard
open fun setIncrements(step: <Error class: unknown class>, page: <Error class: unknown class>)

Sets the step and page increments for spin_button.

Link copied to clipboard

Set all margins to the same value.

fun Widget.setMargins(horizontal: Int = 0, vertical: Int = 0)

Set start and end margin to horizontal and top and bottom margin to vertical

fun Widget.setMargins(start: Int = 0, top: Int = 0, end: Int = 0, bottom: Int = 0)

Set margins.

Link copied to clipboard
open fun setMaxWidthChars(nChars: <Error class: unknown class>)

Sets the desired maximum width in characters of @editable.

Link copied to clipboard
open fun setOrientation(orientation: Orientation)

Sets the orientation of the @orientable.

Link copied to clipboard
open fun setParent(parent: Widget)

Sets @parent as the parent widget of @widget.

Link copied to clipboard
open fun setPosition(position: <Error class: unknown class>)

Sets the cursor position in the editable to the given value.

Link copied to clipboard
open fun setRange(min: <Error class: unknown class>, max: <Error class: unknown class>)

Sets the minimum and maximum allowable values for @spin_button.

Link copied to clipboard
open fun setSensitive(sensitive: Boolean)

Sets the sensitivity of a widget.

Link copied to clipboard
open fun setSizeRequest(width: <Error class: unknown class>, height: <Error class: unknown class>)

Sets the minimum size of a widget.

Link copied to clipboard
open fun setStateFlags(flags: StateFlags, clear: Boolean)

Turns on flag values in the current widget state.

Link copied to clipboard
open fun setText(text: String)

Sets the text in the editable to the given value.

Link copied to clipboard
open fun setVisible(visible: Boolean)

Sets the visibility state of @widget.

Link copied to clipboard
open fun setWidthChars(nChars: <Error class: unknown class>)

Changes the size request of the editable to be about the right size for @n_chars characters.

Link copied to clipboard
open fun shouldLayout(): Boolean

Returns whether @widget should contribute to the measuring and allocation of its parent.

Link copied to clipboard
open fun show()

Flags a widget to be displayed.

Link copied to clipboard
open fun spin(direction: SpinType, increment: <Error class: unknown class>)

Increment or decrement a spin button’s value in a specified direction by a specified amount.

Link copied to clipboard
open fun startEditing(event: <Error class: unknown class>? = null)

Begins editing on a @cell_editable.

Link copied to clipboard

Triggers a tooltip query on the display where the toplevel of @widget is located.

Link copied to clipboard
open fun unmap()

Causes a widget to be unmapped if it’s currently mapped.

Link copied to clipboard
open fun unparent()

Dissociate @widget from its parent.

Link copied to clipboard
open fun unrealize()

Causes a widget to be unrealized (frees all GDK resources associated with the widget).

Link copied to clipboard
open fun unsetStateFlags(flags: StateFlags)

Turns off flag values for the current widget state.

Link copied to clipboard
open fun update()

Manually force an update of the spin button.

Link copied to clipboard
open fun updateNextAccessibleSibling(newSibling: Accessible? = null)

Updates the next accessible sibling of @self.