GimpIntComboBox: GIMP Widgets Library Reference Manual

## GimpIntComboBox GimpIntComboBox — A widget providing a popup menu of integer values (e.g. enums). |

## Functions

gboolean | (*GimpIntSensitivityFunc) ()
GtkWidget * | gimp_int_combo_box_new ()
GtkWidget * | gimp_int_combo_box_new_valist ()
GtkWidget * | gimp_int_combo_box_new_array ()
void | gimp_int_combo_box_prepend ()
void | gimp_int_combo_box_append ()
gboolean | gimp_int_combo_box_set_active ()
gboolean | gimp_int_combo_box_get_active ()
gboolean | gimp_int_combo_box_set_active_by_user_data ()
gboolean | gimp_int_combo_box_get_active_user_data ()
void | gimp_int_combo_box_set_label ()
const gchar * | gimp_int_combo_box_get_label ()
void | gimp_int_combo_box_set_layout ()
GimpIntComboBoxLayout | gimp_int_combo_box_get_layout ()
gulong | gimp_int_combo_box_connect ()
void | gimp_int_combo_box_set_sensitivity ()

## Properties

PangoEllipsizeMode | ellipsize | Read / Write
gchar * | label | Read / Write
GimpIntComboBoxLayout | layout | Read / Write

## Types and Values

| GimpIntComboBox
enum | GimpIntComboBoxLayout

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkWidget
                    ╰── GtkContainer
                        ╰── GtkBin
                            ╰── GtkComboBox
                                ╰── GimpIntComboBox
                                    ╰── GimpEnumComboBox

## Implemented Interfaces

GimpIntComboBox implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

## Description

A widget providing a popup menu of integer values (e.g. enums).

## Functions

### GimpIntSensitivityFunc ()

    gboolean
    (*GimpIntSensitivityFunc) (gint value,
                               gpointer data);

### gimp_int_combo_box_new ()

    GtkWidget *
    gimp_int_combo_box_new (const gchar *first_label,
                            gint first_value,
                            ...);

Creates a GtkComboBox that has integer values associated with each item. The items to fill the combo box with are specified as a `NULL` terminated list of label/value pairs.

If you need to construct an empty GimpIntComboBox, it's best to use g_object_new (GIMP_TYPE_INT_COMBO_BOX, NULL).

#### Parameters

first_label | the label of the first item |
first_value | the value of the first item |
... | a `NULL` terminated list of more label, value pairs |

#### Returns

a new GimpIntComboBox.

Since: 2.2

### gimp_int_combo_box_new_valist ()

    GtkWidget *
    gimp_int_combo_box_new_valist (const gchar *first_label,
                                   gint first_value,
                                   va_list values);

A variant of `gimp_int_combo_box_new()` that takes a va_list of label/value pairs. Probably only useful for language bindings.

#### Parameters

first_label | the label of the first item |
first_value | the value of the first item |
values | a va_list with more values |

#### Returns

a new GimpIntComboBox.

Since: 2.2

### gimp_int_combo_box_new_array ()

    GtkWidget *
    gimp_int_combo_box_new_array (gint n_values,
                                  const gchar *labels[]);

A variant of `gimp_int_combo_box_new()` that takes an array of labels. The array indices are used as values.

#### Parameters

n_values | the number of values |
labels | an array of labels (array length must be `n_values` ) |

#### Returns

a new GimpIntComboBox.

Since: 2.2

### gimp_int_combo_box_prepend ()

    void
    gimp_int_combo_box_prepend (GimpIntComboBox *combo_box,
                                ...);

This function provides a convenient way to prepend items to a GimpIntComboBox. It prepends a row to the `combo_box` 's list store and calls `gtk_list_store_set()` for you.

The column number must be taken from the enum GimpIntStoreColumns.

#### Parameters

combo_box | a GimpIntComboBox |
... | pairs of column number and value, terminated with -1 |

Since: 2.2

### gimp_int_combo_box_append ()

    void
    gimp_int_combo_box_append (GimpIntComboBox *combo_box,
                               ...);

This function provides a convenient way to append items to a GimpIntComboBox. It appends a row to the `combo_box` 's list store and calls `gtk_list_store_set()` for you.

The column number must be taken from the enum GimpIntStoreColumns.

#### Parameters

combo_box | a GimpIntComboBox |
... | pairs of column number and value, terminated with -1 |

Since: 2.2

### gimp_int_combo_box_set_active ()

    gboolean
    gimp_int_combo_box_set_active (GimpIntComboBox *combo_box,
                                   gint value);

Looks up the item that belongs to the given `value` and makes it the selected item in the `combo_box` .

#### Parameters

combo_box | a GimpIntComboBox |
value | an integer value |

#### Returns

`TRUE` on success or `FALSE` if there was no item for this value.

Since: 2.2

### gimp_int_combo_box_get_active ()

    gboolean
    gimp_int_combo_box_get_active (GimpIntComboBox *combo_box,
                                   gint *value);

Retrieves the value of the selected (active) item in the `combo_box` .

#### Parameters

combo_box | a GimpIntComboBox |
value | return location for the integer value |

#### Returns

`TRUE` if `value` has been set or `FALSE` if no item was active.

Since: 2.2

### gimp_int_combo_box_set_active_by_user_data ()

    gboolean
    gimp_int_combo_box_set_active_by_user_data
                                   (GimpIntComboBox *combo_box,
                                    gpointer user_data);

Looks up the item that has the given `user_data` and makes it the selected item in the `combo_box` .

#### Parameters

combo_box | a GimpIntComboBox |
user_data | an integer value |

#### Returns

`TRUE` on success or `FALSE` if there was no item for this user-data.

Since: 2.10

### gimp_int_combo_box_get_active_user_data ()

    gboolean
    gimp_int_combo_box_get_active_user_data
                                   (GimpIntComboBox *combo_box,
                                    gpointer *user_data);

Retrieves the user-data of the selected (active) item in the `combo_box` .

#### Parameters

combo_box | a GimpIntComboBox |
user_data | return location for the gpointer value |

#### Returns

`TRUE` if `user_data` has been set or `FALSE` if no item was active.

Since: 2.10

### gimp_int_combo_box_set_label ()

    void
    gimp_int_combo_box_set_label (GimpIntComboBox *combo_box,
                                  const gchar *label);

Sets a caption on the `combo_box` that will be displayed left-aligned inside the box. When a label is set, the remaining contents of the box will be right-aligned. This is useful for places where screen estate is rare, like in tool options.

#### Parameters

combo_box | a GimpIntComboBox |
label | a string to be shown as label |

Since: 2.10

### gimp_int_combo_box_get_label ()

    const gchar *
    gimp_int_combo_box_get_label (GimpIntComboBox *combo_box);

Returns the label previously set with `gimp_int_combo_box_set_label()`, or `NULL`,

#### Parameters

combo_box | a GimpIntComboBox |

#### Returns

the `combo_box` ' label.

Since: 2.10

### gimp_int_combo_box_set_layout ()

    void
    gimp_int_combo_box_set_layout (GimpIntComboBox *combo_box,
                                   GimpIntComboBoxLayout layout);

Sets the layout of `combo_box` to `layout` .

#### Parameters

combo_box | a GimpIntComboBox |
layout | the combo box layout |

Since: 2.10

### gimp_int_combo_box_get_layout ()

    GimpIntComboBoxLayout
    gimp_int_combo_box_get_layout (GimpIntComboBox *combo_box);

Returns the layout of `combo_box`

#### Parameters

combo_box | a GimpIntComboBox |

#### Returns

the `combo_box` 's layout.

Since: 2.10

### gimp_int_combo_box_connect ()

    gulong
    gimp_int_combo_box_connect (GimpIntComboBox *combo_box,
                                gint value,
                                GCallback callback,
                                gpointer data);

A convenience function that sets the initial `value` of a GimpIntComboBox and connects `callback` to the "changed" signal.

This function also calls the `callback` once after setting the initial `value` . This is often convenient when working with combo boxes that select a default active item, like for example `gimp_drawable_combo_box_new()`. If you pass an invalid initial `value` , the `callback` will be called with the default item active.

#### Parameters

combo_box | a GimpIntComboBox |
value | the value to set |
callback | a callback to connect to the `combo_box` 's "changed" signal |
data | a pointer passed as data to `g_signal_connect()` |

#### Returns

the signal handler ID as returned by `g_signal_connect()`

Since: 2.2

### gimp_int_combo_box_set_sensitivity ()

    void
    gimp_int_combo_box_set_sensitivity (GimpIntComboBox *combo_box,
                                        GimpIntSensitivityFunc func,
                                        gpointer data,
                                        GDestroyNotify destroy);

Sets a function that is used to decide about the sensitivity of rows in the `combo_box` . Use this if you want to set certain rows insensitive.

Calling `gtk_widget_queue_draw()` on the `combo_box` will cause the sensitivity to be updated.

#### Parameters

combo_box | a GimpIntComboBox |
func | a function that returns a boolean value, or `NULL` to unset |
data | data to pass to `func` |
destroy | destroy notification for `data` |

Since: 2.4

## Types and Values

### GimpIntComboBox

    typedef struct _GimpIntComboBox GimpIntComboBox;

### enum GimpIntComboBoxLayout

Possible layouts for GimpIntComboBox.

#### Members

GIMP_INT_COMBO_BOX_LAYOUT_ICON_ONLY | show icons only |
GIMP_INT_COMBO_BOX_LAYOUT_ABBREVIATED | show icons and abbreviated labels, when available |
GIMP_INT_COMBO_BOX_LAYOUT_FULL | show icons and full labels |

Since: 2.10

## Property Details

### The `“ellipsize”` property

      “ellipsize”                PangoEllipsizeMode

Specifies the preferred place to ellipsize text in the combo-box, if the cell renderer does not have enough room to display the entire string.

Owner: GimpIntComboBox

Flags: Read / Write

Default value: PANGO_ELLIPSIZE_NONE

Since: 2.4

### The `“label”` property

      “label”                    gchar *

Sets a label on the combo-box, see `gimp_int_combo_box_set_label()`.

Owner: GimpIntComboBox

Flags: Read / Write

Default value: NULL

Since: 2.10

### The `“layout”` property

      “layout”                   GimpIntComboBoxLayout

Specifies the combo box layout.

Owner: GimpIntComboBox

Flags: Read / Write

Default value: GIMP_INT_COMBO_BOX_LAYOUT_ABBREVIATED

Since: 2.10