mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 11:00:59 +00:00
Set menu when nib is loaded.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5742 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9361d7eff6
commit
30cc8daf8a
2 changed files with 17 additions and 0 deletions
|
@ -41,6 +41,8 @@
|
||||||
#include <Foundation/NSFileManager.h>
|
#include <Foundation/NSFileManager.h>
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
#include <Foundation/NSUserDefaults.h>
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
#include <AppKit/NSApplication.h>
|
||||||
|
#include <AppKit/NSMenu.h>
|
||||||
#include <AppKit/NSControl.h>
|
#include <AppKit/NSControl.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
@ -346,6 +348,7 @@
|
||||||
NSNibConnector *connection;
|
NSNibConnector *connection;
|
||||||
NSString *key;
|
NSString *key;
|
||||||
NSArray *visible;
|
NSArray *visible;
|
||||||
|
NSMenu *menu;
|
||||||
|
|
||||||
_isAwake = YES;
|
_isAwake = YES;
|
||||||
/*
|
/*
|
||||||
|
@ -408,6 +411,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See if there is a main menu to be set.
|
||||||
|
*/
|
||||||
|
menu = [nameTable objectForKey: @"NSMenu"];
|
||||||
|
if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES)
|
||||||
|
{
|
||||||
|
[NSApp setMainMenu: menu];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now remove any objects added from the context dictionary.
|
* Now remove any objects added from the context dictionary.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1060,6 +1060,11 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
if (location && [location isKindOfClass: [NSString class]])
|
if (location && [location isKindOfClass: [NSString class]])
|
||||||
{
|
{
|
||||||
[aWindow setFrameFromString: location];
|
[aWindow setFrameFromString: location];
|
||||||
|
/*
|
||||||
|
* May need resize in case saved frame is out of sync
|
||||||
|
* with number of items in menu.
|
||||||
|
*/
|
||||||
|
[self sizeToFit];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue