{
}
-- (void)doIdle: (id)data;
- (void)sendEvent: (NSEvent*)anEvent;
@end // wxPoserNSApplication
@implementation wxPoserNSApplication : NSApplication
+- (void)sendEvent: (NSEvent*)anEvent
+{
+ wxLogDebug("SendEvent");
+ wxTheApp->CocoaInstallRequestedIdleHandler();
+ [super sendEvent: anEvent];
+}
+
+@end // wxPoserNSApplication
+
+// ========================================================================
+// wxNSApplicationDelegate
+// ========================================================================
+@interface wxNSApplicationDelegate : NSObject
+{
+}
+
+- (void)doIdle: (id)data;
+// Delegate methods
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
+- (void)applicationWillBecomeActive:(NSNotification *)notification;
+- (void)applicationDidBecomeActive:(NSNotification *)notification;
+- (void)applicationWillResignActive:(NSNotification *)notification;
+- (void)applicationDidResignActive:(NSNotification *)notification;
+@end // interface wxNSApplicationDelegate : NSObject
+
+@implementation wxNSApplicationDelegate : NSObject
+
- (void)doIdle: (id)data
{
wxASSERT(wxTheApp);
wxTheApp->CocoaRequestIdle();
}
-- (void)sendEvent: (NSEvent*)anEvent
-{
- wxLogDebug("SendEvent");
- wxTheApp->CocoaInstallRequestedIdleHandler();
- [super sendEvent: anEvent];
-}
-
-@end // wxPoserNSApplication
-
-// ========================================================================
-// wxNSApplicationDelegate
-// ========================================================================
-@interface wxNSApplicationDelegate : NSObject
-{
-}
-
-- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
-- (void)applicationWillBecomeActive:(NSNotification *)notification;
-- (void)applicationDidBecomeActive:(NSNotification *)notification;
-- (void)applicationWillResignActive:(NSNotification *)notification;
-- (void)applicationDidResignActive:(NSNotification *)notification;
-@end // interface wxNSApplicationDelegate : NSObject
-
-@implementation wxNSApplicationDelegate : NSObject
-
// NOTE: Terminate means that the event loop does NOT return and thus
// cleanup code doesn't properly execute. Furthermore, wxWindows has its
// own exit on frame delete mechanism.
m_isIdle = false;
// Call doIdle for EVERYTHING dammit
// We'd need Foundation/NSConnection.h for this next constant, do we need it?
- [[ NSRunLoop currentRunLoop ] performSelector:@selector(doIdle:) target:m_cocoaApp argument:NULL order:0 modes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, /* NSConnectionReplyRunLoopMode,*/ NSModalPanelRunLoopMode, /**/NSEventTrackingRunLoopMode,/**/ nil] ];
+ [[ NSRunLoop currentRunLoop ] performSelector:@selector(doIdle:) target:m_cocoaAppDelegate argument:NULL order:0 modes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, /* NSConnectionReplyRunLoopMode,*/ NSModalPanelRunLoopMode, /**/NSEventTrackingRunLoopMode,/**/ nil] ];
}
void wxApp::CocoaDelegate_applicationWillBecomeActive()
// [ m_cocoaApp setDelegate:m_cocoaApp ];
#if 0
wxLogDebug("Just for kicks");
- [ m_cocoaApp performSelector:@selector(doIdle:) withObject:NULL ];
+ [ m_cocoaAppDelegate performSelector:@selector(doIdle:) withObject:NULL ];
wxLogDebug("okay.. done now");
#endif
return TRUE;