constructing groups of radio actions



There is a little inconvenience in the way groups of radio actions are
constructed via gtk_action_group_add_radio_actions(). The problem is
that this method already connects the "changed" callback, so that it
gets triggered if you set the initial value of the radio group. This can
be seen in gtk-demo, which currently contains the following lines:

gtk_action_group_add_radio_actions (action_group, 
                                    color_entries, n_color_entries, 
				    G_CALLBACK(activate_radio_action),  
                                    NULL);
action = gtk_action_group_get_action (action_group, "Red");
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);

In order to overcome this problem, I'd like to change the signature of
the add_radio_actions() to

void
gtk_action_group_add_radio_actions (GtkActionGroup      *action_group,
                                    GtkRadioActionEntry *entries,
                                    guint                n_entries,
                                    gint                 current_value,
                                    GCallback            on_change,
                                    gpointer             user_data);

Then we could set the inital value before connecting the callback.

Comments ?


Regards, Matthias





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]