XAppIconChooserButton: XApp Reference Manual

## XAppIconChooserButton XAppIconChooserButton — A button for selecting an icon |

## Functions

XAppIconChooserButton * | xapp_icon_chooser_button_new ()
XAppIconChooserButton * | xapp_icon_chooser_button_new_with_size ()
void | xapp_icon_chooser_button_set_icon_size ()
void | xapp_icon_chooser_button_set_icon ()
void | xapp_icon_chooser_button_set_default_category ()
const gchar * | xapp_icon_chooser_button_get_icon ()
XAppIconChooserDialog * | xapp_icon_chooser_button_get_dialog ()

## Properties

char * | category | Read / Write
char * | icon | Read / Write
GtkIconSize | icon-size | Read / Write

## Types and Values

#define | XAPP_TYPE_ICON_CHOOSER_BUTTON
| XAppIconChooserButton

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkButton
                            ╰── XAppIconChooserButton

## Implemented Interfaces

XAppIconChooserButton implements AtkImplementorIface, GtkBuildable, GtkActionable and GtkActivatable.

## Description

The XAppIconChooserButton creates a button so that the user can select an icon. When the button is clicked it will open an XAppIconChooserDialog. The currently selected icon will be displayed as the button image.

## Functions

### xapp_icon_chooser_button_new ()

    XAppIconChooserButton *
    xapp_icon_chooser_button_new (void);

Creates a new XAppIconChooserButton and sets its icon to `icon` .

#### Returns

a newly created XAppIconChooserButton

### xapp_icon_chooser_button_new_with_size ()

    XAppIconChooserButton *
    xapp_icon_chooser_button_new_with_size
                                   (GtkIconSize icon_size);

Creates a new XAppIconChooserButton, and sets the sizes of the button image and the icons in the dialog. Note that xapp_icon_chooser_button_new_with_size (NULL, NULL) is the same as calling `xapp_icon_chooser_button_new()`.

#### Parameters

icon_size | the size of icon to use in the button, or NULL to use the default value. |

#### Returns

a newly created XAppIconChooserButton

### xapp_icon_chooser_button_set_icon_size ()

    void
    xapp_icon_chooser_button_set_icon_size
                                   (XAppIconChooserButton *button,
                                    GtkIconSize icon_size);

Sets the icon size used in the button.

#### Parameters

button | a XAppIconChooserButton |
icon_size | the size of icon to use in the button, or -1 to use the default value. |

### xapp_icon_chooser_button_set_icon ()

    void
    xapp_icon_chooser_button_set_icon (XAppIconChooserButton *button,
                                       const gchar *icon);

Sets the icon on the XAppIconChooserButton.

#### Parameters

button | a XAppIconChooserButton |
icon | a string representing the icon to be set. This may be an icon name or a file path. | [nullable]

### xapp_icon_chooser_button_set_default_category ()

    void
    xapp_icon_chooser_button_set_default_category
                                   (XAppIconChooserButton *button,
                                    const gchar *category);

Sets the icon on the XAppIconChooserButton.

#### Parameters

button | a XAppIconChooserButton |
category | a string representing the category selected by default. | [nullable]

### xapp_icon_chooser_button_get_icon ()

    const gchar *
    xapp_icon_chooser_button_get_icon (XAppIconChooserButton *button);

Gets the icon from the XAppIconChooserButton.

#### Parameters

button | a XAppIconChooserButton |

#### Returns

a string representing the icon. This may be an icon name or a file path.

### xapp_icon_chooser_button_get_dialog ()

    XAppIconChooserDialog *
    xapp_icon_chooser_button_get_dialog (XAppIconChooserButton *button);

Gets a reference to the icon chooser dialog for the XAppIconChooserButton. This is useful for setting properties on the dialog.

#### Parameters

button | a XAppIconChooserButton |

#### Returns

the XAppIconChooserDialog.

[transfer none]

## Types and Values

### XAPP_TYPE_ICON_CHOOSER_BUTTON

    #define XAPP_TYPE_ICON_CHOOSER_BUTTON   (xapp_icon_chooser_button_get_type ())

### XAppIconChooserButton

    typedef struct _XAppIconChooserButton XAppIconChooserButton;

## Property Details

### The `“category”` property

      “category”                 char *

The category selected by default.

Owner: XAppIconChooserButton

Flags: Read / Write

Default value: ""

### The `“icon”` property

      “icon”                     char *

The preferred size to use when looking up icons. This only works with icon names. Additionally, there is no guarantee that a selected icon name will exist in a particular size.

Owner: XAppIconChooserButton

Flags: Read / Write

Default value: ""

### The `“icon-size”` property

      “icon-size”                GtkIconSize

The size to use when displaying the icon.

Owner: XAppIconChooserButton

Flags: Read / Write

Default value: GTK_ICON_SIZE_DND