Author: manolo
Date: 2011-10-26 05:42:41 -0700 (Wed, 26 Oct 2011)
New Revision: 9152
Log:
Mac OS: restore the focus to the top FLTK window after closing the window 
opened by the
 "About ..." item of the application menu. This issue appeared with OS X 10.7.

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-10-26 11:17:31 UTC (rev 9151)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-10-26 12:42:41 UTC (rev 9152)
@@ -2825,6 +2825,7 @@
 }
 - (void)showPanel;
 - (void)printPanel;
+- (void)closePanel:(NSNotification *)notif;
 @end
 @implementation FLaboutItemTarget
 - (void)showPanel
@@ -2836,7 +2837,16 @@
                FL_MAJOR_VERSION, FL_MINOR_VERSION ]] autorelease], @"Credits",
                             nil];
     [NSApp orderFrontStandardAboutPanelWithOptions:options];
-  }
+  [[NSNotificationCenter defaultCenter] addObserver:self 
+                                          selector:@selector(closePanel:) 
+                                              
name:NSWindowWillCloseNotification 
+                                            object:[NSApp keyWindow]];
+}
+- (void)closePanel:(NSNotification *)notif
+{
+  [[NSApp delegate] windowWillClose:notif];
+  [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
 //#include <FL/Fl_PostScript.H>
 - (void)printPanel
 {

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to