Re: GtkRadioMenuItem set active problem
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Subject: Re: GtkRadioMenuItem set active problem
- Date: 28 May 2001 12:03:19 -0400
Jeff Franks <jcf tpg com au> writes:
> Hi,
>
> I've come across a problem with GtkRadioMenuItem. The only way to set
> the active item in a group is to call 'gtk_check_menu_item_set_active'
> which also emits an 'activate' signal. This is ok when a program is up
> and running but when you are initializing a program, emitting an
> 'activate' signal can be undesireable. When adding a group of
> radiomenuitems all you really want to do is let GtkRadioMenuItem know
> which way to draw its indicator. Since
> 'gtk_radio_menu_item_draw_indicator' checks 'GtkCheckMenuItem::active'
> before drawing the indicator wouldn't it be reasonable to let
> GtkRadioMenuItem have a way to set/unset this flag without emitting an
> 'activate signal. The best place for this might be as extra parameter
> in the 'gtk_radio_menu_item_new' functions.
I don't see this is being any different from a toggle button,
where gtk_toggle_button_set_active() emits ::toggled.
Generally, in response to any sort of change notification, instead of
assuming that a change happened, you should get the current state and
compare it against your internal state.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]