GimpEnumWidgets

GimpEnumWidgets — A set of utility functions to create widgets based on enums.

Functions

Description

A set of utility functions to create widgets based on enums.

Functions

gimp_enum_radio_box_new ()

GtkWidget *
gimp_enum_radio_box_new (GType enum_type,
                         GCallback callback,
                         gpointer callback_data,
                         GDestroyNotify callback_data_destroy,
                         GtkWidget **first_button);

Creates a new group of GtkRadioButtons representing the enum values. A group of radiobuttons is a good way to represent enums with up to three or four values. Often it is better to use a GimpEnumComboBox instead.

Parameters

enum_type

the GType of an enum.

 

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new GtkBox holding a group of GtkRadioButtons.

[transfer full]

Since: 2.4


gimp_enum_radio_box_new_with_range ()

GtkWidget *
gimp_enum_radio_box_new_with_range (GType enum_type,
                                    gint minimum,
                                    gint maximum,
                                    GCallback callback,
                                    gpointer callback_data,
                                    GDestroyNotify callback_data_destroy,
                                    GtkWidget **first_button);

Just like gimp_enum_radio_box_new(), this function creates a group of radio buttons, but additionally it supports limiting the range of available enum values.

Parameters

minimum

the minimum enum value

 

maximum

the maximum enum value

 

enum_type

the GType of an enum.

 

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new vertical GtkBox holding a group of GtkRadioButtons.

[transfer full]

Since: 2.4


gimp_enum_radio_frame_new ()

GtkWidget *
gimp_enum_radio_frame_new (GType enum_type,
                           GtkWidget *label_widget,
                           GCallback callback,
                           gpointer callback_data,
                           GDestroyNotify callback_data_destroy,
                           GtkWidget **first_button);

Calls gimp_enum_radio_box_new() and puts the resulting vbox into a GtkFrame.

Parameters

enum_type

the GType of an enum.

 

label_widget

a GtkWidget to use as label for the frame that will hold the radio box.

[nullable]

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new GtkFrame holding a group of GtkRadioButtons.

[transfer full]

Since: 2.4


gimp_enum_radio_frame_new_with_range ()

GtkWidget *
gimp_enum_radio_frame_new_with_range (GType enum_type,
                                      gint minimum,
                                      gint maximum,
                                      GtkWidget *label_widget,
                                      GCallback callback,
                                      gpointer callback_data,
                                      GDestroyNotify callback_data_destroy,
                                      GtkWidget **first_button);

Calls gimp_enum_radio_box_new_with_range() and puts the resulting vertical box into a GtkFrame.

Parameters

enum_type

the GType of an enum.

 

minimum

the minimum enum value

 

maximum

the maximum enum value

 

label_widget

a widget to put into the frame that will hold the radio box.

[nullable]

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new GtkFrame holding a group of GtkRadioButtons.

[transfer full]

Since: 2.4


gimp_enum_icon_box_new ()

GtkWidget *
gimp_enum_icon_box_new (GType enum_type,
                        const gchar *icon_prefix,
                        GtkIconSize icon_size,
                        GCallback callback,
                        gpointer callback_data,
                        GDestroyNotify callback_data_destroy,
                        GtkWidget **first_button);

Creates a horizontal box of radio buttons with named icons. The icon name for each icon is created by appending the enum_value's nick to the given icon_prefix .

Parameters

enum_type

the GType of an enum.

 

icon_prefix

the prefix of the group of icon names to use.

 

icon_size

the icon size for the icons

 

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new horizontal GtkBox holding a group of GtkRadioButtons.

[transfer full]

Since: 2.10


gimp_enum_icon_box_new_with_range ()

GtkWidget *
gimp_enum_icon_box_new_with_range (GType enum_type,
                                   gint minimum,
                                   gint maximum,
                                   const gchar *icon_prefix,
                                   GtkIconSize icon_size,
                                   GCallback callback,
                                   gpointer callback_data,
                                   GDestroyNotify callback_data_destroy,
                                   GtkWidget **first_button);

Just like gimp_enum_icon_box_new(), this function creates a group of radio buttons, but additionally it supports limiting the range of available enum values.

Parameters

enum_type

the GType of an enum.

 

minimum

the minumim enum value

 

maximum

the maximum enum value

 

icon_prefix

the prefix of the group of icon names to use.

 

icon_size

the icon size for the icons

 

callback

a callback to connect to the "toggled" signal of each GtkRadioButton that is created.

[nullable]

callback_data

data to pass to the callback .

 

callback_data_destroy

Destroy function for callback_data .

 

first_button

Returns the first button in the created group.

[out][optional][transfer none]

Returns

a new horizontal GtkBox holding a group of GtkRadioButtons.

[transfer full]

Since: 2.10


gimp_enum_icon_box_set_child_padding ()

void
gimp_enum_icon_box_set_child_padding (GtkWidget *icon_box,
                                      gint xpad,
                                      gint ypad);

Sets the padding of all buttons in a box created by gimp_enum_icon_box_new().

Parameters

icon_box

an icon box widget

 

xpad

horizontal padding

 

ypad

vertical padding

 

Since: 2.10

Types and Values