int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
{
wxMacAutoreleasePool autoreleasepool;
-
+
EventRef event;
OSStatus status = ReceiveNextEvent(0, NULL, timeout/1000, true, &event);
switch ( status )
}
}
+void wxGUIEventLoop::WakeUp()
+{
+ OSStatus err = noErr;
+ wxMacCarbonEvent wakeupEvent;
+ wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
+ kEventAttributeNone );
+ err = PostEventToQueue(GetMainEventQueue(), wakeupEvent,
+ kEventPriorityHigh );
+}
+
void wxGUIEventLoop::DoRun()
{
wxMacAutoreleasePool autoreleasepool;
QuitApplicationEventLoop();
}
+CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
+{
+ return wxCFEventLoop::CFGetCurrentRunLoop();
+}
+
// TODO move into a evtloop_osx.cpp
wxModalEventLoop::wxModalEventLoop(wxWindow *modalWindow)
{
- m_modalWindow = dynamic_cast<wxNonOwnedWindow*> (modalWindow);
+ m_modalWindow = wxDynamicCast(modalWindow, wxNonOwnedWindow);
wxASSERT_MSG( m_modalWindow != NULL, "must pass in a toplevel window for modal event loop" );
m_modalNativeWindow = m_modalWindow->GetWXWindow();
}
void wxModalEventLoop::DoRun()
{
+ wxWindowDisabler disabler(m_modalWindow);
wxMacAutoreleasePool autoreleasepool;
bool resetGroupParent = false;
WindowGroupRef windowGroup = NULL;
WindowGroupRef formerParentGroup = NULL;
-
+
// make sure modal dialogs are in the right layer so that they are not covered
if ( m_modalWindow != NULL )
{
}
m_modalWindow->SetFocus();
-
+
RunAppModalLoopForWindow(m_modalNativeWindow);
if ( resetGroupParent )