Re: [Gtk-osx-devs] FYI: proper synching of GtkRadioMenuItems




On Jul 13, 2010, at 2:26 AM, Richard Procter wrote:

On Jun 22, 2010, at 2:43 PM, Richard Procter wrote:

Hi,

I have raised a bug http://bugzilla.gnome.org/show_bug.cgi?id=622260
with a tentative patch.


Thanks for filing the bug and patch.

No problem! (I've taken a while to reply as my account hasn't  
received any gtk-osx-devs messages apart from the initial welcome).

It's odd, though, because I have this specific test case (a pair of  
radiomenuitems) in testintegration.c and the synchronization works  
there, both in the MenuBar and in the Dock Menu.

That is odd.

Looking at test-integration.c, I note that  
gtk_action_group_add_radio_actions_full connects to the 'changed'  
signal (which I presume means the 'group-changed' signal; the gtk+  
documentation looks muddled). However, the integration menubar relies  
on notify::active.


It just looks that way because I used actions to set up the menu. The actual work tracking the checks happens in cocoa_menu_item_notify(), which calls cocoa_menu_item_update_checked() when either the :active or :inconsistent properties.
Grouping menu items the way gtk_menu_radio_group does is done in user code in Cocoa, so there's no good way to have the ige-mac-integration code handle it for you to help maintain the exactly-one behavior. 

IIRC you're switching off signals and re-synching the menus. Could some amount of state be leaking through somehow? I didn't set up a test of that particular case.

Regards,
John Ralls







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