overriding the cfrunloop accessor, during booting cocoa has to create a NSRunLoop earlier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2010-04-22 06:16:34 +00:00
parent ebeac822d9
commit 7934e44732
3 changed files with 15 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ protected:
virtual void DoRun();
virtual void DoStop();
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
};
#endif // _WX_OSX_COCOA_EVTLOOP_H_

View File

@@ -94,6 +94,11 @@ void wxGUIEventLoop::DoStop()
QuitApplicationEventLoop();
}
CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
{
return wxCFEventLoop::CFGetCurrentRunLoop();
}
// TODO move into a evtloop_osx.cpp
wxModalEventLoop::wxModalEventLoop(wxWindow *modalWindow)
@@ -114,6 +119,7 @@ wxModalEventLoop::wxModalEventLoop(WXWindow modalNativeWindow)
void wxModalEventLoop::DoRun()
{
wxWindowDisabler disabler(m_modalWindow);
wxMacAutoreleasePool autoreleasepool;
bool resetGroupParent = false;

View File

@@ -175,6 +175,13 @@ void wxGUIEventLoop::DoStop()
[NSApp stop:0];
}
CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
{
NSRunLoop* nsloop = [NSRunLoop currentRunLoop];
return [nsloop getCFRunLoop];
}
// TODO move into a evtloop_osx.cpp
wxModalEventLoop::wxModalEventLoop(wxWindow *modalWindow)