Top | ![]() |
![]() |
![]() |
![]() |
GSList * | gwy_radio_buttons_create () |
GSList * | gwy_radio_buttons_createl () |
gint | gwy_radio_buttons_attach_to_grid () |
gboolean | gwy_radio_buttons_set_current () |
gint | gwy_radio_buttons_get_current () |
GtkWidget * | gwy_radio_buttons_find () |
void | gwy_radio_buttons_set_sensitive () |
gint | gwy_radio_button_get_value () |
void | gwy_radio_button_set_value () |
Groups of buttons associated with some integers can be easily constructed from GwyEnum's with
gwy_radio_buttons_create()
.
GSList * gwy_radio_buttons_create (const GwyEnum *entries
,gint nentries
,GCallback callback
,gpointer cbdata
,gint current
);
Creates a radio button group from an enum.
Try to avoid -1 as an enum value.
entries |
Radio button group items. |
|
nentries |
The number of items. A negative value means that |
|
callback |
A callback called when a button is selected (or |
|
cbdata |
User data passed to the callback. |
|
current |
Value to be shown as currently selected (-1 to use what happens to be first). |
GSList * gwy_radio_buttons_createl (GCallback callback
,gpointer cbdata
,gint current
,...
);
Creates a radio button group from a list of label/value pairs.
callback |
A callback called when a button is selected (or |
|
cbdata |
User data passed to the callback. |
|
current |
Value to be shown as currently selected (-1 to use what happens to be first). |
|
... |
First item label, first item value, second item label, second item value, etc. Terminated with |
gint gwy_radio_buttons_attach_to_grid (GSList *group
,GtkGrid *grid
,gint colspan
,gint row
);
Attaches a group of radio buttons to grid rows.
group |
A radio button group. Not necessarily created by |
|
grid |
A grid widget. |
|
colspan |
The number of columns the radio buttons should span across. |
|
row |
Table row to start attaching at. |
gboolean gwy_radio_buttons_set_current (GSList *group
,gint current
);
Sets currently selected radio button in group
based on integer item object
data (as set by gwy_radio_buttons_create()
).
group |
A radio button group created by |
|
current |
Value to be shown as currently selected. |
gint
gwy_radio_buttons_get_current (GSList *group
);
Gets the integer enum value corresponding to currently selected item.
GtkWidget * gwy_radio_buttons_find (GSList *group
,gint value
);
Finds a radio button by its associated integer value.
group |
A radio button group created by |
|
value |
The value associated with the button to find. |
void gwy_radio_buttons_set_sensitive (GSList *group
,gboolean sensitive
);
Sets the sensitivity of all radio buttons in a group.
This function is useful to make the choice as a whole available/unavailable. Use gwy_radio_buttons_find()
combined
with gtk_widget_set_sensitive()
to manage sensitivity of individual options.
group |
A radio button group. Not necessarily created by |
|
sensitive |
|
gint
gwy_radio_button_get_value (GtkWidget *button
);
Gets the integer value associated with a radio button.
void gwy_radio_button_set_value (GtkWidget *button
,gint value
);
Sets the integer value associated with a radio button.
This function allow to change associated radio button values after creation or even construct a radio button group
with associated integers without the help of gwy_radio_buttons_create()
.