mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Set main storyboard
This commit is contained in:
parent
70a3baa428
commit
5456b9b5a6
2 changed files with 19 additions and 2 deletions
|
@ -48,6 +48,13 @@
|
|||
|
||||
char **NSArgv = NULL;
|
||||
|
||||
@interface NSStoryboard (Private)
|
||||
|
||||
+ (void) setMainStoryboard: (NSStoryboard *)storyboard;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/*
|
||||
* Main initialization routine for the GNUstep GUI Library Apps
|
||||
*/
|
||||
|
@ -91,11 +98,16 @@ NSApplicationMain(int argc, const char **argv)
|
|||
mainModelFile = [infoDict objectForKey: @"NSMainStoryboardFile"];
|
||||
if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO)
|
||||
{
|
||||
if ([NSStoryboard storyboardWithName: mainModelFile
|
||||
bundle: [NSBundle mainBundle]] == nil)
|
||||
NSStoryboard *storyboard = [NSStoryboard storyboardWithName: mainModelFile
|
||||
bundle: [NSBundle mainBundle]];
|
||||
if (storyboard == nil)
|
||||
{
|
||||
NSLog (_(@"Cannot load the main storyboard file '%@'"), mainModelFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSStoryboard setMainStoryboard: storyboard];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -47,6 +47,11 @@ static NSStoryboard *mainStoryboard = nil;
|
|||
}
|
||||
|
||||
// Class methods...
|
||||
+ (void) setMainStoryboard: (NSStoryboard *)storyboard
|
||||
{
|
||||
mainStoryboard = storyboard;
|
||||
}
|
||||
|
||||
+ (NSStoryboard *) mainStoryboard // 10.13
|
||||
{
|
||||
return mainStoryboard;
|
||||
|
|
Loading…
Reference in a new issue