Implement wxApp::Yield
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSAutoreleasePool.h>
|
#import <Foundation/NSAutoreleasePool.h>
|
||||||
#import <Foundation/NSThread.h>
|
#import <Foundation/NSThread.h>
|
||||||
|
#import <AppKit/NSEvent.h>
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// globals
|
// globals
|
||||||
@@ -192,7 +193,6 @@ wxApp::wxApp()
|
|||||||
m_isInAssert = FALSE;
|
m_isInAssert = FALSE;
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
|
|
||||||
argc = 0;
|
argc = 0;
|
||||||
argv = NULL;
|
argv = NULL;
|
||||||
m_cocoaApp = NULL;
|
m_cocoaApp = NULL;
|
||||||
@@ -316,8 +316,15 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
|
|
||||||
s_inYield = true;
|
s_inYield = true;
|
||||||
|
|
||||||
wxLogDebug("WARNING: SUPPOSED to have yielded!");
|
// Run the event loop until it is out of events
|
||||||
// FIXME: Do something!
|
while(NSEvent *event = [GetNSApplication()
|
||||||
|
nextEventMatchingMask:NSAnyEventMask
|
||||||
|
untilDate:[NSDate distantPast]
|
||||||
|
inMode:NSDefaultRunLoopMode
|
||||||
|
dequeue: YES])
|
||||||
|
{
|
||||||
|
[GetNSApplication() sendEvent: event];
|
||||||
|
}
|
||||||
|
|
||||||
#if wxUSE_LOG
|
#if wxUSE_LOG
|
||||||
// let the logs be flashed again
|
// let the logs be flashed again
|
||||||
|
Reference in New Issue
Block a user