mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
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:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user