SplitButton

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

A combined button and dropdown widget.

split-button

AdwSplitButton is typically used to present a set of actions in a menu, but allow access to one of them with a single click.

The API is very similar to class@Gtk.Button and class@Gtk.MenuButton, see their documentation for details.

CSS nodes

splitbutton[.image-button][.text-button]
├── button
│ ╰── <content>
├── separator
╰── menubutton
╰── button.toggle
╰── arrow

AdwSplitButton's CSS node is called splitbutton. It contains the css nodes: button, separator, menubutton. See class@Gtk.MenuButton documentation for the menubutton contents.

The main CSS node will contain the .image-button or .text-button style classes matching the button contents. The nested button nodes will never contain them.

Style classes

AdwSplitButton can use some of the same style classes as class@Gtk.Button:

  • style-classes.html#suggested-action

  • style-classes.html#destructive-action

  • style-classes.html#flat

  • style-classes.html#raised

Other style classes, like .pill, cannot be used.

Accessibility

AdwSplitButton uses the GTK_ACCESSIBLE_ROLE_GROUP role.

Skipped during bindings generation

  • method icon-name: Property TypeInfo of getter and setter do not match

  • method label: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor()

Creates a new AdwSplitButton.

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwSplitButtonPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether the button can be smaller than the natural size of its contents.

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

The child widget.

Link copied to clipboard
var direction: <Error class: unknown class>

The direction in which the popup will be popped up.

Link copied to clipboard

The tooltip of the dropdown button.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkActionablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var menuModel: <Error class: unknown class>?

The GMenuModel from which the popup will be created.

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

The GtkPopover that will be popped up when the dropdown is clicked.

Link copied to clipboard

Whether an underline in the text indicates a mnemonic.

Functions

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

Emitted to animate press then release.

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

Emitted when the button has been activated (pressed and released).

Link copied to clipboard

gets whether the button can be smaller than the natural size of its contents.

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

Gets the child widget.

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

Gets the direction in which the popup will be popped up.

Link copied to clipboard

Gets the tooltip of the dropdown button of @self.

Link copied to clipboard

Gets the name of the icon used to automatically populate the button.

Link copied to clipboard

Gets the label for @self.

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

Gets the menu model from which the popup will be created.

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

Gets the popover that will be popped up when the dropdown is clicked.

Link copied to clipboard

Gets whether an underline in the text indicates a mnemonic.

Link copied to clipboard
fun popdown()

Dismisses the menu.

Link copied to clipboard
fun popup()

Pops up the menu.

Link copied to clipboard
fun setCanShrink(canShrink: Boolean)

Sets whether the button can be smaller than the natural size of its contents.

Link copied to clipboard
fun setChild(child: <Error class: unknown class>? = null)

Sets the child widget.

Link copied to clipboard
fun setDirection_(direction: <Error class: unknown class>)

Sets the direction in which the popup will be popped up.

Link copied to clipboard

Sets the tooltip of the dropdown button of @self.

Link copied to clipboard
fun setIconName(iconName: String)

Sets the name of the icon used to automatically populate the button.

Link copied to clipboard
fun setLabel(label: String)

Sets the label for @self.

Link copied to clipboard
fun setMenuModel(menuModel: <Error class: unknown class>? = null)

Sets the menu model from which the popup will be created.

Link copied to clipboard
fun setPopover(popover: <Error class: unknown class>? = null)

Sets the popover that will be popped up when the dropdown is clicked.

Link copied to clipboard
fun setUseUnderline(useUnderline: Boolean)

Sets whether an underline in the text indicates a mnemonic.