[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GUI issue - adding item to Menu
From: |
Riccardo Mottola |
Subject: |
GUI issue - adding item to Menu |
Date: |
Fri, 13 May 2016 11:22:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; OpenBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
Hi,
I discovered a very strange behaviour. I think it is a bug and it would
be nice in case to solve it before release.
I think that if the Main app menu is called "X" and you add a submenu
also called "X" and then add items Y to submenu X, they get added to the
main menu and the submeni disappears.
Where to check: latest Terminal code from GAP.
Code in main.m:
http://svn.savannah.nongnu.org/viewvc/trunk/system-apps/Terminal/main.m?revision=3185&root=gap&view=markup
Terminal has a Main Menu called "Terminal". It used to have a sub-menu
called Terminal (there are screenshots that prove that it worked). The
code was commented out.
I put it back in, it doesn't work well.
However if I name the submenu "foo" it works. I suppose a quirk!
The code section is:
/* 'Terminal' menu */
m=[[NSMenu alloc] init];
[m addItemWithTitle: _(@"New window")
action: @selector(openWindow:)
keyEquivalent: @"n"];
[m addItemWithTitle: _(@"New tab")
action: @selector(openTab:)
keyEquivalent: @"t"];
[menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Terminal")]];
[m release];
Ideas?
Riccardo:
- GUI issue - adding item to Menu,
Riccardo Mottola <=