Set main storyboard

This commit is contained in:
Gregory John Casamento 2020-06-19 08:53:09 -04:00
parent 70a3baa428
commit 5456b9b5a6
2 changed files with 19 additions and 2 deletions

View file

@ -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
{

View file

@ -47,6 +47,11 @@ static NSStoryboard *mainStoryboard = nil;
}
// Class methods...
+ (void) setMainStoryboard: (NSStoryboard *)storyboard
{
mainStoryboard = storyboard;
}
+ (NSStoryboard *) mainStoryboard // 10.13
{
return mainStoryboard;