Renamed chdir option, added OS X menu bar option.

Some command-line programs want to render to hidden windows without any
visible UI.  This option makes this possible on OS X.
This commit is contained in:
Camilla Berglund
2013-01-24 19:45:21 +01:00
parent 6abb8e4c86
commit 8c766b57e7
4 changed files with 18 additions and 7 deletions
+6
View File
@@ -581,6 +581,8 @@ static NSString* findAppName(void)
// doesn't seem like a good thing to require of GLFW's clients.
//========================================================================
#if defined(_GLFW_USE_MENUBAR)
static void createMenuBar(void)
{
NSString* appName = findAppName();
@@ -640,6 +642,8 @@ static void createMenuBar(void)
[NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu];
}
#endif /* _GLFW_USE_MENUBAR */
//========================================================================
// Initialize the Cocoa Application Kit
@@ -653,10 +657,12 @@ static GLboolean initializeAppKit(void)
// Implicitly create shared NSApplication instance
[GLFWApplication sharedApplication];
#if defined(_GLFW_USE_MENUBAR)
// Menu bar setup must go between sharedApplication above and
// finishLaunching below, in order to properly emulate the behavior
// of NSApplicationMain
createMenuBar();
#endif
[NSApp finishLaunching];