Skip to content
Browse files

Fixing menubar issues in Mac OS 10.8

  • Loading branch information...
1 parent 4214f76 commit b2d76dfd717f722033ca30a91c0e45546257dc1f @andrewfb andrewfb committed Aug 24, 2012
Showing with 14 additions and 11 deletions.
  1. +1 −1 include/cinder/app/AppImplCocoaBasic.h
  2. +10 −1 src/cinder/app/AppBasic.cpp
  3. +3 −9 src/cinder/app/AppImplCocoaBasic.mm
View
2 include/cinder/app/AppImplCocoaBasic.h
@@ -34,7 +34,7 @@
@class CinderWindow;
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
-@interface AppImplCocoaBasic : NSApplication<NSWindowDelegate,CinderViewMultiTouchDelegate> {
+@interface AppImplCocoaBasic : NSObject<NSApplicationDelegate,NSWindowDelegate,CinderViewMultiTouchDelegate> {
#else
@interface AppImplCocoaBasic : NSApplication {
#endif
View
11 src/cinder/app/AppBasic.cpp
@@ -92,7 +92,16 @@ void AppBasic::launch( const char *title, int argc, char * const argv[] )
}
#if defined( CINDER_COCOA )
- mImpl = [[::AppImplCocoaBasic alloc] init:this];
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSApplication * application = [NSApplication sharedApplication];
+
+ mImpl = [[AppImplCocoaBasic alloc] init:this];
+
+ [application setDelegate:mImpl];
+ [application run];
+
+ [pool drain];
+
#else
mImpl = new AppImplMswBasic( this );
mImpl->run();
View
12 src/cinder/app/AppImplCocoaBasic.mm
@@ -44,10 +44,8 @@ @implementation AppImplCocoaBasic
- (id)init:(cinder::app::AppBasic*)aApp
{
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
- [NSApplication sharedApplication];
-
+ self = [super init];
+
[NSApp setMainMenu:[[NSMenu alloc] init]];
const std::string& applicationName = aApp->getSettings().getTitle();
@@ -60,12 +58,8 @@ - (id)init:(cinder::app::AppBasic*)aApp
cinderView = nil;
win = nil;
mNeedsUpdate = YES;
-
- [NSApp run];
-
- [pool release];
- return 0;
+ return self;
}
- (void)dealloc

0 comments on commit b2d76df

Please sign in to comment.
Something went wrong with that request. Please try again.