ButtonContent
Object Hierarchy:
Adw.ButtonContent
Adw.ButtonContent
Adw.ButtonContent
Gtk.Widget
Gtk.Widget
Gtk.Widget->Adw.ButtonContent
GLib.InitiallyUnowned
GLib.InitiallyUnowned
GLib.InitiallyUnowned->Gtk.Widget
GLib.Object
GLib.Object
GLib.Object->GLib.InitiallyUnowned
Gtk.Accessible
Gtk.Accessible
Gtk.Accessible->Adw.ButtonContent
Gtk.Accessible->Gtk.Widget
Gtk.Buildable
Gtk.Buildable
Gtk.Buildable->Adw.ButtonContent
Gtk.Buildable->Gtk.Widget
Gtk.ConstraintTarget
Gtk.ConstraintTarget
Gtk.ConstraintTarget->Adw.ButtonContent
Gtk.ConstraintTarget->Gtk.Widget
Description:
[ CCode ( type_id = "adw_button_content_get_type ()" ) ] [ Version ( since = "1.0" ) ]public sealed class ButtonContent : Widget , Accessible , Buildable , ConstraintTarget
A helper widget for creating buttons.
<picture> <source srcset="button-content-dark.png" media="(prefers-color-scheme: dark)"> <img src="button-content.png"
alt="button-content"> </picture>
`AdwButtonContent` is a box-like widget with an icon and a label.
It's intended to be used as a direct child of [[email protected] ], [[email protected] ] or [class@SplitButton], when they need to have
both an icon and a label, as follows:
```xml <object class="GtkButton"> <property name="child"> <object class="AdwButtonContent"> <property
name="icon-name">document-open-symbolic</property> <property name="label" translatable="yes">_Open</property> <
property name="use-underline">True</property> </object> </property> </object> ```
`AdwButtonContent` handles style classes and connecting the mnemonic to the button automatically.
CSS nodes
``` buttoncontent ├── image ╰── label ```
`AdwButtonContent`'s CSS node is called `buttoncontent`. It contains the subnodes `image` and `label`.
When inside a `GtkButton` or `AdwSplitButton`, the button will receive the `.image-text-button` style class. When inside a
`GtkMenuButton`, the internal `GtkButton` will receive it instead.
Accessibility
`AdwButtonContent` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
Content:
Properties:
Creation methods:
Methods:
public unowned string get_icon_name ()
Gets the name of the displayed icon.
public unowned string get_label ()
Gets the displayed label.
public bool get_use_underline ()
Gets whether an underline in the text indicates a mnemonic.
public void set_icon_name (string icon_name)
Sets the name of the displayed icon.
public void set_label (string label)
Sets the displayed label.
public void set_use_underline (bool use_underline)
Sets whether an underline in the text indicates a mnemonic.
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.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