#include "wx/cocoa/ObjcPose.h"
#include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/mbarman.h"
#if wxUSE_WX_RESOURCES
# include "wx/resource.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSThread.h>
+#import <AppKit/NSEvent.h>
// ----------------------------------------------------------------------------
// globals
- (void)doIdle: (id)data
{
wxASSERT(wxTheApp);
+ wxASSERT(wxMenuBarManager::GetInstance());
+ wxMenuBarManager::GetInstance()->CocoaInternalIdle();
wxLogDebug("doIdle called");
#ifdef __WXDEBUG__
if(wxTheApp->IsInAssert())
void wxApp::CleanUp()
{
wxDC::CocoaShutdownTextSystem();
+ wxMenuBarManager::DestroyInstance();
wxAppBase::CleanUp();
}
m_isInAssert = FALSE;
#endif // __WXDEBUG__
-
argc = 0;
argv = NULL;
m_cocoaApp = NULL;
// Create the app using the sharedApplication method
m_cocoaApp = [NSApplication sharedApplication];
+
+ wxMenuBarManager::CreateInstance();
+
wxDC::CocoaInitializeTextSystem();
// [ m_cocoaApp setDelegate:m_cocoaApp ];
#if 0
s_inYield = true;
- wxLogDebug("WARNING: SUPPOSED to have yielded!");
- // FIXME: Do something!
+ // Run the event loop until it is out of events
+ while(NSEvent *event = [GetNSApplication()
+ nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantPast]
+ inMode:NSDefaultRunLoopMode
+ dequeue: YES])
+ {
+ [GetNSApplication() sendEvent: event];
+ }
#if wxUSE_LOG
// let the logs be flashed again