mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 15:20:38 +00:00
per-window menu setting tweaks.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27686 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c47c417df7
commit
0d5c221a7d
8 changed files with 100 additions and 35 deletions
|
@ -5164,19 +5164,30 @@ current key view.<br />
|
|||
|
||||
- (void) setMenu: (NSMenu *)menu
|
||||
{
|
||||
NSMenuView *menuView;
|
||||
|
||||
menuView = [[self menu] menuRepresentation];
|
||||
if (menuView != nil)
|
||||
[_wv removeMenuView: menuView];
|
||||
[super setMenu: menu];
|
||||
menuView = [menu menuRepresentation];
|
||||
if (menuView != nil)
|
||||
if ([self menu] != menu)
|
||||
{
|
||||
[menu close];
|
||||
[menuView setHorizontal: YES];
|
||||
[menuView sizeToFit];
|
||||
[_wv addMenuView: menuView];
|
||||
NSMenuView *menuView;
|
||||
|
||||
/* Restore the old representation to its original menu after
|
||||
* removing it from the window. If we didn't do this, the menu
|
||||
* representation would be left without a partent view or
|
||||
* window to draw in.
|
||||
*/
|
||||
menuView = [_wv removeMenuView];
|
||||
[[self menu] setMenuRepresentation: menuView];
|
||||
|
||||
/* Set the new menu, and transfer the new menu representation
|
||||
* to the window decoration view.
|
||||
*/
|
||||
[super setMenu: menu];
|
||||
menuView = [menu menuRepresentation];
|
||||
if (menuView != nil)
|
||||
{
|
||||
[menu close];
|
||||
[menuView setHorizontal: YES];
|
||||
[menuView sizeToFit];
|
||||
[_wv addMenuView: menuView];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue