adw.split_button

Module for [SplitButton] class

Types 3

A combined button and dropdown widget.

split-button

[adw.split_button.SplitButton] 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 [gtk.button.Button] and [gtk.menu_button.MenuButton], see their documentation for details.

CSS nodes

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

[adw.split_button.SplitButton]'s CSS node is called splitbutton. It contains the css nodes: button, separator, menubutton. See [gtk.menu_button.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.

Accessibility

[adw.split_button.SplitButton] uses the [gtk.types.AccessibleRole.Group] role.

Methods
GType _gType() @property
SplitButton self()Returns `this`, for use in `with` statements.
SplitButtonGidBuilder builder()Get builder for [adw.split_button.SplitButton] Returns: New builder object
bool canShrink() @propertyGet `canShrink` property. Returns: Whether the button can be smaller than the natural size of its contents.
void canShrink(bool propval) @propertySet `canShrink` property. Params: propval = Whether the button can be smaller than the natural size of its contents.
gtk.widget.Widget child() @propertyGet `child` property. Returns: The child widget.
void child(gtk.widget.Widget propval) @propertySet `child` property. Params: propval = The child widget.
gtk.types.ArrowType direction() @propertyGet `direction` property. Returns: The direction in which the popup will be popped up.
void direction(gtk.types.ArrowType propval) @propertySet `direction` property. Params: propval = The direction in which the popup will be popped up.
string dropdownTooltip() @propertyGet `dropdownTooltip` property. Returns: The tooltip of the dropdown button.
void dropdownTooltip(string propval) @propertySet `dropdownTooltip` property. Params: propval = The tooltip of the dropdown button.
string iconName() @propertyGet `iconName` property. Returns: The name of the icon used to automatically populate the button.
void iconName(string propval) @propertySet `iconName` property. Params: propval = The name of the icon used to automatically populate the button.
string label() @propertyGet `label` property. Returns: The label for the button.
void label(string propval) @propertySet `label` property. Params: propval = The label for the button.
gio.menu_model.MenuModel menuModel() @propertyGet `menuModel` property. Returns: The [gio.menu_model.MenuModel] from which the popup will be created.
void menuModel(gio.menu_model.MenuModel propval) @propertySet `menuModel` property. Params: propval = The [gio.menu_model.MenuModel] from which the popup will be created.
gtk.popover.Popover popover() @propertyGet `popover` property. Returns: The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
void popover(gtk.popover.Popover propval) @propertySet `popover` property. Params: propval = The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
bool useUnderline() @propertyGet `useUnderline` property. Returns: Whether an underline in the text indicates a mnemonic.
void useUnderline(bool propval) @propertySet `useUnderline` property. Params: propval = Whether an underline in the text indicates a mnemonic.
bool getCanShrink()gets whether the button can be smaller than the natural size of its contents. Returns: whether the button can shrink
gtk.widget.Widget getChild()Gets the child widget. Returns: the child widget
gtk.types.ArrowType getDirection()Gets the direction in which the popup will be popped up. Returns: the direction
string getDropdownTooltip()Gets the tooltip of the dropdown button of self. Returns: the dropdown tooltip of self
string getIconName()Gets the name of the icon used to automatically populate the button. Returns: the icon name
string getLabel()Gets the label for self. Returns: the label for self
gio.menu_model.MenuModel getMenuModel()Gets the menu model from which the popup will be created. Returns: the menu model
gtk.popover.Popover getPopover()Gets the popover that will be popped up when the dropdown is clicked. Returns: the popover
bool getUseUnderline()Gets whether an underline in the text indicates a mnemonic. Returns: whether an underline in the text indicates a mnemonic
void popdown()Dismisses the menu.
void popup()Pops up the menu.
void setCanShrink(bool canShrink)Sets whether the button can be smaller than the natural size of its contents.
void setChild(gtk.widget.Widget child = null)Sets the child widget.
void setDirection(gtk.types.ArrowType direction)Sets the direction in which the popup will be popped up.
void setDropdownTooltip(string tooltip)Sets the tooltip of the dropdown button of self.
void setIconName(string iconName)Sets the name of the icon used to automatically populate the button.
void setLabel(string label)Sets the label for self.
void setMenuModel(gio.menu_model.MenuModel menuModel = null)Sets the menu model from which the popup will be created.
void setPopover(gtk.popover.Popover popover = null)Sets the popover that will be popped up when the dropdown is clicked.
void setUseUnderline(bool useUnderline)Sets whether an underline in the text indicates a mnemonic.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : adw.split_button.SplitButton))) && Parameters!T.length < 2)Connect to `Activate` signal.
gulong connectClicked(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : adw.split_button.SplitButton))) && Parameters!T.length < 2)Connect to `Clicked` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.splitbutton.SplitButton]. Returns: the newly created [adw.splitbutton.SplitButton]
Methods
T canShrink(bool propval)Set `canShrink` property. Params: propval = Whether the button can be smaller than the natural size of its contents.
T child(gtk.widget.Widget propval)Set `child` property. Params: propval = The child widget.
T direction(gtk.types.ArrowType propval)Set `direction` property. Params: propval = The direction in which the popup will be popped up.
T dropdownTooltip(string propval)Set `dropdownTooltip` property. Params: propval = The tooltip of the dropdown button.
T iconName(string propval)Set `iconName` property. Params: propval = The name of the icon used to automatically populate the button.
T label(string propval)Set `label` property. Params: propval = The label for the button.
T menuModel(gio.menu_model.MenuModel propval)Set `menuModel` property. Params: propval = The [gio.menu_model.MenuModel] from which the popup will be created.
T popover(gtk.popover.Popover propval)Set `popover` property. Params: propval = The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
T useUnderline(bool propval)Set `useUnderline` property. Params: propval = Whether an underline in the text indicates a mnemonic.

Fluent builder for [adw.split_button.SplitButton]