Re: [Gtk-osx-users] menu synchronisation
- From: Olivier Sessink <oliviersessink gmail com>
- To: John Ralls <jralls ceridwen fremont ca us>, gtk-osx-users lists sourceforge net
- Subject: Re: [Gtk-osx-users] menu synchronisation
- Date: Sun, 4 Apr 2010 18:04:35 +0200
ok, the other issues:
- Bluefish has plugins. All menu items created by the plugins show up
empty for some reason. Debugging shows that get_menu_label_text()
returns NULL for those entries. I don't understand why.
- Bluefish may use multiple windows. If I open a second windows and
issue <ctrl><f> (find) the find dialog opens on top of the first
window. If I close the first window, the menu is gone.
regards,
Olivier
2010/4/4 John Ralls <jralls ceridwen fremont ca us>:
>
> On Apr 4, 2010, at 5:28 AM, Olivier Sessink wrote:
>
> I added this bit to the loop in sync_menu_shell, and now it works:
>
> GtkWidget *submenu;
> submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
> if (submenu) {
> sync_menu_shell (GTK_MENU_SHELL(submenu), carbon_item->submenu,FALSE,
> debug);
> }
>
> I still have some minor other issues, but I'll work on that.
>
>
> Yes, you're half right. The recursion is in carbon_menu_item_create, which
> has a fragment similar to what you wrote above, but calls
> carbon_menu_item_update_submenu. That has creation and deletion code for the
> carbon-side submenu, then recurses back into sync_menu_shell. The part
> you're right about is that if the menu item containing the menu isn't new,
> sync_menu_shell won't recurse into the submenu, so your GtkCheckMenuItem
> toggling won't work.
> You'll get a second pass through sync_menu_shell during initial setup which
> will waste some cycles but should be otherwise harmless. You could prevent
> that by protecting your addition above with an "else" off of the creation
> check, like so:
>
> if (!carbon_item)
> carbon_item = carbon_menu_item_create(menu_item, carbon_menu,
> carbon_index, debug);
> else {
> GtkWidget *submenu;
> submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
> if (submenu) {
> sync_menu_shell (GTK_MENU_SHELL(submenu), carbon_item->submenu,FALSE,
> debug);
> }
> }
> Alternatively, you could move the recursion out of
> carbon_menu_item_update_submenu, which would probably be cleaner, though a
> bit more work.
> Thanks for working through this; it's helped clarify some things in my mind
> which will go into the Cocoa version. (Do tell me about the "minor other
> issues" for the same reason.)
> Regards,
> John Ralls
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]