gwyradiobuttons

gwyradiobuttons —

Synopsis




GSList*     gwy_radio_buttons_create        (const GwyEnum *entries,
                                             gint nentries,
                                             const gchar *key,
                                             GCallback callback,
                                             gpointer cbdata,
                                             gint current);
gboolean    gwy_radio_buttons_set_current   (GSList *group,
                                             const gchar *key,
                                             gint current);
gint        gwy_radio_buttons_get_current   (GSList *group,
                                             const gchar *key);
gboolean    gwy_radio_buttons_set_current_from_widget
                                            (GtkWidget *widget,
                                             const gchar *key,
                                             gint current);
gint        gwy_radio_buttons_get_current_from_widget
                                            (GtkWidget *widget,
                                             const gchar *key);

Description

Details

gwy_radio_buttons_create ()

GSList*     gwy_radio_buttons_create        (const GwyEnum *entries,
                                             gint nentries,
                                             const gchar *key,
                                             GCallback callback,
                                             gpointer cbdata,
                                             gint current);

Creates a radio button group for an enum.

It sets object data identified by key for each menu item to its value. Try to avoid -1 as an enum value.

entries: Radio button group items.
nentries: The number of items.
key: Value object data key.
callback: A callback called when a menu item is activated (or NULL for no callback).
cbdata: User data passed to the callback.
current: Value to be shown as currently selected (-1 to use what happens to be first).
Returns : The newly created radio button group (a GSList). Iterate over the list and pack the widgets (the order is the same as in entries).

Since 1.2.


gwy_radio_buttons_set_current ()

gboolean    gwy_radio_buttons_set_current   (GSList *group,
                                             const gchar *key,
                                             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 gwy_radio_buttons_create().
key: Value object data key (specified as key when called gwy_radio_buttons_create()).
current: Value to be shown as currently selected.
Returns : TRUE if current button was set, FALSE if current was not found.

Since 1.2.


gwy_radio_buttons_get_current ()

gint        gwy_radio_buttons_get_current   (GSList *group,
                                             const gchar *key);

Gets the integer enum value corresponding to currently selected item.

group: A radio button group created by gwy_radio_buttons_create().
key: Value object data key (specified as key when called gwy_radio_buttons_create()).
Returns : The enum value corresponding to currently selected item. In case of failure -1 is returned.

Since 1.2.


gwy_radio_buttons_set_current_from_widget ()

gboolean    gwy_radio_buttons_set_current_from_widget
                                            (GtkWidget *widget,
                                             const gchar *key,
                                             gint current);

Sets currently selected radio button in group based on integer item object data (as set by gwy_radio_buttons_create()).

widget: A member of a radio button group created by gwy_radio_buttons_create().
key: Value object data key (specified as key when called gwy_radio_buttons_create()).
current: Value to be shown as currently selected.
Returns : TRUE if current button was set, FALSE if current was not found.

Since 1.2.


gwy_radio_buttons_get_current_from_widget ()

gint        gwy_radio_buttons_get_current_from_widget
                                            (GtkWidget *widget,
                                             const gchar *key);

Gets the integer enum value corresponding to currently selected item.

widget: A member of a radio button group created by gwy_radio_buttons_create().
key: Value object data key (specified as key when called gwy_radio_buttons_create()).
Returns : The enum value corresponding to currently selected item. In case of failure -1 is returned.

Since 1.2.