- ................
- #import <CoreServices/CoreServices.h>
- @implementation NSApplication (SystemVersion)
- + (BOOL) usingLionOSX
- {
- SInt32 minorVersion = 0;
- SInt32 majorVersion = 0;
- Gestalt(gestaltSystemVersionMajor, &majorVersion);
- Gestalt(gestaltSystemVersionMinor, &minorVersion);
- return majorVersion == 10 && minorVersion >= 7;
- }
- @end
- ................
- IBOutlet NSWindow* _mainWindow; // in h-file
- ................
- - (void) applicationDidFinishLaunching : (NSNotification*) notification
- {
- #if (defined(MAC_OS_X_VERSION_10_7)) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- if ( [ NSApplication usingLionOSX ] )
- {
- [ [ NSApplication sharedApplication ] setPresentationOptions : NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock ];
- NSWindowCollectionBehavior collection = [ _mainWindow collectionBehavior ];
- collection |= NSWindowCollectionBehaviorFullScreenPrimary;
- [ _mainWindow setCollectionBehavior : collection ];
- [ _mainWindow toggleFullScreen : self ];
- }
- #endif
- }
понедельник, 5 сентября 2011 г.
Manually set the full-screen mode at startup application in Lion 10.7
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий