diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index 5145328d27..5e79828ca2 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -83,14 +83,21 @@ public: // TODO change semantics to be in line with cocoa (make autrelease NOT increase the count) void MacAddToAutorelease( void* cfrefobj ); void MacReleaseAutoreleasePool(); + public: static wxWindow* s_captureWindow ; static long s_lastModifiers ; int m_nCmdShow; -private: // mac specifics +protected: +#if wxOSX_USE_COCOA + // override for support of custom app controllers + virtual WX_NSObject OSXCreateAppController(); +#endif + +private: virtual bool DoInitGui(); virtual void DoCleanUp(); diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 8b80a601b1..f4702bb185 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -259,10 +259,14 @@ void wxBell() @end -wxNSAppController* appcontroller = nil; +WX_NSObject appcontroller = nil; NSLayoutManager* gNSLayoutManager = nil; +WX_NSObject wxApp::OSXCreateAppController() +{ + return [[wxNSAppController alloc] init]; +} bool wxApp::DoInitGui() { @@ -272,7 +276,7 @@ bool wxApp::DoInitGui() { [wxNSApplication sharedApplication]; - appcontroller = [[wxNSAppController alloc] init]; + appcontroller = OSXCreateAppController(); [NSApp setDelegate:appcontroller]; // calling finishLaunching so early before running the loop seems to trigger some 'MenuManager compatibility' which leads