]> git.saurik.com Git - wxWidgets.git/commitdiff
Observe NSControlTintDidChangeNotification in the application delegate.
authorDavid Elliott <dfe@tgwbd.org>
Tue, 22 Jun 2004 04:16:22 +0000 (04:16 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 22 Jun 2004 04:16:22 +0000 (04:16 +0000)
TODO: Actually implement this to do something.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/NSApplication.h
src/cocoa/app.mm

index 35ead1e8f57caf6d0aba65b286b9df08ea897a3b..40cc6364e461ced4f5cf03423e8c7dedc9a24bb5 100644 (file)
@@ -25,6 +25,9 @@
 - (void)applicationDidBecomeActive:(NSNotification *)notification;
 - (void)applicationWillResignActive:(NSNotification *)notification;
 - (void)applicationDidResignActive:(NSNotification *)notification;
+
+// Other notifications
+- (void)controlTintChanged:(NSNotification *)notification;
 @end // interface wxNSApplicationDelegate : NSObject
 
 #endif //ndef _WX_COCOA_NSAPPLICATION_H__
index 2e01d1055863feed7ac24359ad7879442c6680d8..f8f064934f73bb861a6af0ffce3bc8e72fdf0c55 100644 (file)
@@ -34,6 +34,8 @@
 #import <Foundation/NSThread.h>
 #import <AppKit/NSEvent.h>
 #import <Foundation/NSString.h>
+#import <Foundation/NSNotification.h>
+#import <AppKit/NSCell.h>
 
 // ========================================================================
 // wxPoseAsInitializer
@@ -146,6 +148,11 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication);
     wxTheApp->CocoaDelegate_applicationDidResignActive();
 }
 
+- (void)controlTintChanged:(NSNotification *)notification
+{
+    wxLogDebug("TODO: send EVT_SYS_COLOUR_CHANGED as appropriate");
+}
+
 @end // implementation wxNSApplicationDelegate : NSObject
 
 // ========================================================================
@@ -199,6 +206,8 @@ void wxApp::CleanUp()
     wxMenuBarManager::DestroyInstance();
 
     [m_cocoaApp setDelegate:nil];
+    [[NSNotificationCenter defaultCenter] removeObserver:m_cocoaAppDelegate
+        name:NSControlTintDidChangeNotification object:nil];
     [m_cocoaAppDelegate release];
     m_cocoaAppDelegate = NULL;
 
@@ -252,11 +261,13 @@ bool wxApp::OnInitGui()
     m_cocoaApp = [NSApplication sharedApplication];
     m_cocoaAppDelegate = [[wxNSApplicationDelegate alloc] init];
     [m_cocoaApp setDelegate:m_cocoaAppDelegate];
+    [[NSNotificationCenter defaultCenter] addObserver:m_cocoaAppDelegate
+        selector:@selector(controlTintChanged:)
+        name:NSControlTintDidChangeNotification object:nil];
 
     wxMenuBarManager::CreateInstance();
 
     wxDC::CocoaInitializeTextSystem();
-//    [ m_cocoaApp setDelegate:m_cocoaApp ];
     return TRUE;
 }