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 _getGType() static nothrow
GType _gType() @property nothrow
SplitButton self() nothrowReturns `this`, for use in `with` statements.
SplitButtonGidBuilder builder() static nothrowGet builder for [adw.split_button.SplitButton] Returns: New builder object
bool canShrink() @property nothrowGet `canShrink` property. Returns: Whether the button can be smaller than the natural size of its contents.
void canShrink(bool propval) @property nothrowSet `canShrink` property. Params: propval = Whether the button can be smaller than the natural size of its contents.
gtk.widget.Widget child() @property nothrowGet `child` property. Returns: The child widget.
void child(gtk.widget.Widget propval) @property nothrowSet `child` property. Params: propval = The child widget.
gtk.types.ArrowType direction() @property nothrowGet `direction` property. Returns: The direction in which the popup will be popped up.
void direction(gtk.types.ArrowType propval) @property nothrowSet `direction` property. Params: propval = The direction in which the popup will be popped up.
string dropdownTooltip() @property nothrowGet `dropdownTooltip` property. Returns: The tooltip of the dropdown button.
void dropdownTooltip(string propval) @property nothrowSet `dropdownTooltip` property. Params: propval = The tooltip of the dropdown button.
string iconName() @property nothrowGet `iconName` property. Returns: The name of the icon used to automatically populate the button.
void iconName(string propval) @property nothrowSet `iconName` property. Params: propval = The name of the icon used to automatically populate the button.
string label() @property nothrowGet `label` property. Returns: The label for the button.
void label(string propval) @property nothrowSet `label` property. Params: propval = The label for the button.
gio.menu_model.MenuModel menuModel() @property nothrowGet `menuModel` property. Returns: The [gio.menu_model.MenuModel] from which the popup will be created.
void menuModel(gio.menu_model.MenuModel propval) @property nothrowSet `menuModel` property. Params: propval = The [gio.menu_model.MenuModel] from which the popup will be created.
gtk.popover.Popover popover() @property nothrowGet `popover` property. Returns: The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
void popover(gtk.popover.Popover propval) @property nothrowSet `popover` property. Params: propval = The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
bool useUnderline() @property nothrowGet `useUnderline` property. Returns: Whether an underline in the text indicates a mnemonic.
void useUnderline(bool propval) @property nothrowSet `useUnderline` property. Params: propval = Whether an underline in the text indicates a mnemonic.
bool getCanShrink() nothrowgets whether the button can be smaller than the natural size of its contents. Returns: whether the button can shrink
gtk.widget.Widget getChild() nothrowGets the child widget. Returns: the child widget
gtk.types.ArrowType getDirection() nothrowGets the direction in which the popup will be popped up. Returns: the direction
string getDropdownTooltip() nothrowGets the tooltip of the dropdown button of self. Returns: the dropdown tooltip of self
string getIconName() nothrowGets the name of the icon used to automatically populate the button. Returns: the icon name
string getLabel() nothrowGets the label for self. Returns: the label for self
gio.menu_model.MenuModel getMenuModel() nothrowGets the menu model from which the popup will be created. Returns: the menu model
gtk.popover.Popover getPopover() nothrowGets the popover that will be popped up when the dropdown is clicked. Returns: the popover
bool getUseUnderline() nothrowGets whether an underline in the text indicates a mnemonic. Returns: whether an underline in the text indicates a mnemonic
void popdown() nothrowDismisses the menu.
void popup() nothrowPops up the menu.
void setCanShrink(bool canShrink) nothrowSets whether the button can be smaller than the natural size of its contents.
void setChild(gtk.widget.Widget child = null) nothrowSets the child widget.
void setDirection(gtk.types.ArrowType direction) nothrowSets the direction in which the popup will be popped up.
void setDropdownTooltip(string tooltip) nothrowSets the tooltip of the dropdown button of self.
void setIconName(string iconName) nothrowSets the name of the icon used to automatically populate the button.
void setLabel(string label) nothrowSets the label for self.
void setMenuModel(gio.menu_model.MenuModel menuModel = null) nothrowSets the menu model from which the popup will be created.
void setPopover(gtk.popover.Popover popover = null) nothrowSets the popover that will be popped up when the dropdown is clicked.
void setUseUnderline(bool useUnderline) nothrowSets 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) nothrowConnect 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) nothrowConnect to `Clicked` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.split_button.SplitButton]. Returns: the newly created [adw.split_button.SplitButton]

Fluent builder implementation template for adw.split_button.SplitButton

Methods
T canShrink(bool propval) nothrowSet `canShrink` property. Params: propval = Whether the button can be smaller than the natural size of its contents.
T child(gtk.widget.Widget propval) nothrowSet `child` property. Params: propval = The child widget.
T direction(gtk.types.ArrowType propval) nothrowSet `direction` property. Params: propval = The direction in which the popup will be popped up.
T dropdownTooltip(string propval) nothrowSet `dropdownTooltip` property. Params: propval = The tooltip of the dropdown button.
T iconName(string propval) nothrowSet `iconName` property. Params: propval = The name of the icon used to automatically populate the button.
T label(string propval) nothrowSet `label` property. Params: propval = The label for the button.
T menuModel(gio.menu_model.MenuModel propval) nothrowSet `menuModel` property. Params: propval = The [gio.menu_model.MenuModel] from which the popup will be created.
T popover(gtk.popover.Popover propval) nothrowSet `popover` property. Params: propval = The [gtk.popover.Popover] that will be popped up when the dropdown is clicked.
T useUnderline(bool propval) nothrowSet `useUnderline` property. Params: propval = Whether an underline in the text indicates a mnemonic.

Fluent builder for adw.split_button.SplitButton

Methods
SplitButton build() nothrowCreate object from builder. Returns: New object