After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172345 - Gtk::RadioAction, unable to specifiy initial activated entry without emitting signals.
Gtk::RadioAction, unable to specifiy initial activated entry without emitting...
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: general
2.6.x
Other NetBSD
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 323007
Blocks:
 
 
Reported: 2005-04-01 11:55 UTC by Frank Naumann
Modified: 2005-12-14 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
radio_action_set_current_value.patch (3.45 KB, patch)
2005-12-02 11:52 UTC, Murray Cumming
none Details | Review

Description Frank Naumann 2005-04-01 11:55:25 UTC
Under gtkmm it's not possible to specifiy the initial activated entry for
Gtk::RadioAction's. Always the first inserted Gtk::RadioAction is the initial
activated. Under gtk+ it's done by gtk_action_group_add_radio_actions() (the
value argument).
Comment 1 Murray Cumming 2005-04-06 13:04:06 UTC
You can store the action and activate it. Can you suggest some other API?
Comment 2 Murray Cumming 2005-04-21 11:29:38 UTC
Anything?
Comment 3 Frank Naumann 2005-04-21 20:56:15 UTC
Sorry for the delay ...

Yes, you can activate the action. But it's not the same semantic as it can be
done  with the C interface. With the C interface you can set the default action
without activating anything. If you activate the action the attached signals are
called out thus doing something that normally only the user initiate. This can
also be difficult if you setup the actions in a constructor as you need to
verify the action can be safely activated from this place.
Comment 4 Murray Cumming 2005-04-26 10:35:55 UTC
Can you suggest some other API?
Comment 5 Frank Naumann 2005-04-28 07:15:13 UTC
Gtk::RadioAction have a method get_current_value() to obtain the value property
of the currently active member of the group. What about a set_current_value() to
set the active member? Helpful is then also an additional constructor to specify
the value property (and/or get/set methods for the value property).
Comment 6 Murray Cumming 2005-12-02 11:50:29 UTC
I tried to implement set_current_value in gtkmm (see patch), but there is no
public GTK+ API to get the GtkActionGroup from the GtkRadioAction/GtkAction. I
requested an implementation in GTK+ in bug #323007.
Comment 7 Murray Cumming 2005-12-02 11:52:08 UTC
Created attachment 55518 [details] [review]
radio_action_set_current_value.patch

Unfinished patch.
Comment 8 Murray Cumming 2005-12-02 12:32:48 UTC
> With the C interface you can set the default action
> without activating anything. If you activate the action the attached signals are
> called out thus doing something that normally only the user initiate.

gtk_action_group_add_radio_action() does this by activating the action before
connecting the signal. You can do that too in the C++ API, by calling
RadioAction::set_active() before calling ActionGroup::add(action, *). 


Maybe it would help to add a bool active parameter to RadioAction::create(), but
it already has lots of parameters.
Comment 9 Murray Cumming 2005-12-06 10:16:14 UTC
Thoughts?
Comment 10 Murray Cumming 2005-12-14 14:19:50 UTC
So, please reopen if RadioAction::set_active() (before adding to the group)
isn't useful enough.