Adw.ButtonContent
Description: Reference for Adw.ButtonContent

### Class

# AdwButtonContent

#### Description [src]

    final class Adw.ButtonContent : Gtk.Widget {
      /* No available fields */
    }

A helper widget for creating buttons.

`AdwButtonContent` is a box-like widget with an icon and a label.

It’s intended to be used as a direct child of `GtkButton`, `GtkMenuButton` or `AdwSplitButton`, when they need to have both an icon and a label, as follows:

    <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.

Available since: | 1.0

#### Hierarchy

#### Ancestors

- GtkWidget
- GInitiallyUnowned
- GObject

#### Implements

- GtkAccessible
- GtkBuildable
- GtkConstraintTarget

#### Constructors

###### adw_button_content_new

Creates a new `AdwButtonContent`.

Available since: 1.0

#### Instance methods

###### adw_button_content_get_icon_name

Gets the name of the displayed icon.

Available since: 1.0

###### adw_button_content_get_label

Gets the displayed label.

Available since: 1.0

###### adw_button_content_get_use_underline

Gets whether an underline in the text indicates a mnemonic.

Available since: 1.0

###### adw_button_content_set_icon_name

Sets the name of the displayed icon.

Available since: 1.0

###### adw_button_content_set_label

Sets the displayed label.

Available since: 1.0

###### adw_button_content_set_use_underline

Sets whether an underline in the text indicates a mnemonic.

Available since: 1.0

##### Methods inherited from GtkWidget (159)

##### Methods inherited from GObject (43)

#### Properties

###### Adw.ButtonContent:icon-name

The name of the displayed icon.

Available since: 1.0

###### Adw.ButtonContent:label

The displayed label.

Available since: 1.0

###### Adw.ButtonContent:use-underline

Whether an underline in the text indicates a mnemonic.

Available since: 1.0

##### Properties inherited from GtkWidget (34)

#### Signals

##### Signals inherited from GtkWidget (13)

##### Signals inherited from GObject (1)

#### Class structure

    struct AdwButtonContentClass {
      GtkWidgetClass parent_class;

    }

###### Class members

`parent_class` |
    GtkWidgetClass
| No description available.