Re: [Gtk-osx-users] menu synchronisation
- From: John Ralls <jralls ceridwen fremont ca us>
- To: GTK+-2 OSX Users <gtk-osx-users lists sourceforge net>
- Subject: Re: [Gtk-osx-users] menu synchronisation
- Date: Fri, 2 Apr 2010 07:05:14 -0700
On Apr 2, 2010, at 6:06 AM, Olivier Sessink wrote:
> John Ralls wrote:
>> On Mar 31, 2010, at 11:41 PM, Olivier Sessink wrote:
>>> Hi all,
>>> I'm having some issues with the menu synchronisation. The correct
>>> menu options are all there, but the state of radio menu items and
>>> toggle menu items are not synchronised. Is this a known issue? How
>>> can I debug this?
>> First study ige-mac-integration/src/ige-mac-menu.c so that you
>> understand how the events operate on checked menu items.
> after looking at the code it seems that the state of checked menu items
> is not sync'ed at all, except during creation. Is this correct?
> Somewhere on line 920 we need a check if the menu item is a check menu
> item, and what the state is, and set the state of the carbon menu
> accordingly. Correct?
No. The section between 909 and 927 adjusts the index if a menu item addition or deletion has caused the index to be off by one.
But changing the checked state during synchronization wouldn't do what you want anyway, because you don't call ige-mac-menu-sync in the menu event handlers. You call it when you've changed the menu layout by adding, deleting, or hiding a menu item.
What you want is for carbon_menu_item_update_active to be called during event handling. It is, at line 530, in carbon_menu_item_notify, which is a callback function registered at line 574 in carbon_menu_item_connect. The problem is likely to be that the pspec->name received in carbon_menu_item_notify isn't "active" when your GtkCheckMenuItem is clicked, so that's the first thing to debug on.
] [Thread Prev