wxGUIEventLoop();
~wxGUIEventLoop();
+ int Run();
+
void BeginModalSession( wxWindow* modalWindow );
void EndModalSession();
void OSXUseLowLevelWakeup(bool useIt)
{ m_osxLowLevelWakeUp = useIt ; }
+ void OSXOnWillTerminate();
+
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
static int gs_loopNestingLevel = 0;
+int wxGUIEventLoop::Run()
+{
+ // because we are using native callbacks for notifying about entering and exiting
+ // the main event loop, we must this leave out here
+
+ // event loops are not recursive, you need to create another loop!
+ wxCHECK_MSG( !IsInsideRun(), -1, wxT("can't reenter a message loop") );
+
+ // We might be called again, after a previous call to ScheduleExit(), so
+ // reset this flag.
+ m_shouldExit = false;
+
+ // Set this variable to true for the duration of this method.
+ m_isInsideRun = true;
+ wxON_BLOCK_EXIT_SET(m_isInsideRun, false);
+
+ // Finally really run the loop.
+ return DoRun();
+}
+
void wxGUIEventLoop::OSXDoRun()
{
/*
// We should only stop the top level event loop.
if ( gs_loopNestingLevel <= 1 )
{
- [NSApp stop:0];
+ // using terminate support all native notifications
+ [NSApp terminate:0];
}
// For the top level loop only calling stop: is not enough when called from
WakeUp();
}
+void wxGUIEventLoop::OSXOnWillTerminate()
+{
+ OnExit();
+}
+
void wxGUIEventLoop::WakeUp()
{
// NSEvent* cevent = [NSApp currentEvent];