SplitButton


Object Hierarchy:

Object hierarchy for SplitButton

Description:

[ CCode ( type_id = "adw_split_button_get_type ()" ) ]
public sealed class SplitButton : Widget, Accessible, Actionable, Buildable, ConstraintTarget

A combined button and dropdown widget.

<picture> <source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)"> <img src="split-button.png" alt="split-button"> </picture>

`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 ├── 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]:

  • [`.suggested-action`](style-classes.html#suggested-action)
  • [`.destructive-action`](style-classes.html#destructive-action)
  • [`.flat`](style-classes.html#flat)
  • [`.raised`](style-classes.html#raised)

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

Accessibility

`AdwSplitButton` uses the [enum@Gtk.AccessibleRole.group] role.


Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Widget