bool wxGUIEventLoop::Pending() const
{
+ wxMacAutoreleasePool autoreleasepool;
// a pointer to the event is returned if there is one, or nil if not
return [[NSApplication sharedApplication]
nextEventMatchingMask: NSAnyEventMask
return true;
}
+
+int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
+{
+ wxMacAutoreleasePool autoreleasepool;
+
+ NSEvent *event = [NSApp
+ nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate dateWithTimeIntervalSinceNow: timeout/1000]
+ inMode:NSDefaultRunLoopMode
+ dequeue: YES];
+ if ( !event )
+ return -1;
+
+ [NSApp sendEvent: event];
+
+ return true;
+}