SplitButton
Object Hierarchy:
Adw.SplitButton
Adw.SplitButton
Adw.SplitButton
Gtk.Widget
Gtk.Widget
Gtk.Widget->Adw.SplitButton
GLib.InitiallyUnowned
GLib.InitiallyUnowned
GLib.InitiallyUnowned->Gtk.Widget
GLib.Object
GLib.Object
GLib.Object->GLib.InitiallyUnowned
Gtk.Accessible
Gtk.Accessible
Gtk.Accessible->Adw.SplitButton
Gtk.Accessible->Gtk.Widget
Gtk.Buildable
Gtk.Buildable
Gtk.Buildable->Adw.SplitButton
Gtk.Buildable->Gtk.Widget
Gtk.ConstraintTarget
Gtk.ConstraintTarget
Gtk.ConstraintTarget->Adw.SplitButton
Gtk.ConstraintTarget->Gtk.Widget
Gtk.Actionable
Gtk.Actionable
Gtk.Actionable->Adw.SplitButton
Description:
[ CCode ( type_id = "adw_split_button_get_type ()" ) ] [ Version ( since = "1.0" ) ]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 [[email protected] ] and [[email protected] ], 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 [
[email protected] ] 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
`AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
Content:
Properties:
public Widget child { get ; set ; }
The child widget.
public ArrowType direction { get ; set ; }
The direction in which the popup will be popped up.
public string dropdown_tooltip { get ; set ; }
The tooltip of the dropdown button.
public string icon_name { get ; set ; }
The name of the icon used to automatically populate the button.
public string label { get ; set ; }
The label for the button.
public MenuModel menu_model { get ; set ; }
The `GMenuModel` from which the popup will be created.
public Popover popover { get ; set ; }
The `GtkPopover` that will be popped up when the dropdown is clicked.
public bool use_underline { get ; set ; }
Whether an underline in the text indicates a mnemonic.
Creation methods:
Methods:
public unowned Widget ? get_child ()
Gets the child widget.
public ArrowType get_direction ()
Gets the direction in which the popup will be popped up.
public unowned string get_dropdown_tooltip ()
Gets the tooltip of the dropdown button of
this .
public unowned string ? get_icon_name ()
Gets the name of the icon used to automatically populate the button.
public unowned string ? get_label ()
Gets the label for this .
public unowned MenuModel ? get_menu_model ()
Gets the menu model from which the popup will be created.
public unowned Popover ? get_popover ()
Gets the popover that will be popped up when the dropdown is clicked.
public bool get_use_underline ()
Gets whether an underline in the text indicates a mnemonic.
public void popdown ()
Dismisses the menu.
public void popup ()
Pops up the menu.
public void set_child (Widget ? child)
Sets the child widget.
public void set_direction (ArrowType direction)
Sets the direction in which the popup will be popped up.
public void set_dropdown_tooltip (string tooltip)
Sets the tooltip of the dropdown button of
this .
public void set_icon_name (string icon_name)
Sets the name of the icon used to automatically populate the button.
public void set_label (string label)
Sets the label for this .
public void set_menu_model (MenuModel ? menu_model)
Sets the menu model from which the popup will be created.
public void set_popover (Popover ? popover)
Sets the popover that will be popped up when the dropdown is clicked.
public void set_use_underline (bool use_underline)
Sets whether an underline in the text indicates a mnemonic.
Signals:
Inherited Members:
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Gtk.Accessible
accessible_role
get_accessible_role
reset_property
reset_relation
reset_state
update_property
update_property_value
update_relation
update_relation_value
update_state
update_state_value
All known members inherited from interface Gtk.Actionable
action_name
action_target
get_action_name
get_action_target_value
set_action_name
set_action_target
set_action_target_value
set_detailed_action_name
All known members inherited from interface Gtk.Buildable
add_child
custom_finished
custom_tag_end
custom_tag_start
get_buildable_id
get_id
get_internal_child
parser_finished
set_buildable_property
set_id