]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/evtloop.mm
bring in the definition of wxSizer, making non-precomp builds working again after...
[wxWidgets.git] / src / osx / cocoa / evtloop.mm
index a8a8c561d7a0551747ff1fe093d29fd520b7709d..1d607f9eaf4022a5dc0b0f58b96d897dc5a248ea 100644 (file)
@@ -50,6 +50,7 @@ void wxGUIEventLoop::WakeUp()
 
 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
@@ -91,3 +92,20 @@ bool wxGUIEventLoop::Dispatch()
 
     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;
+}