Author: manolo
Date: 2011-10-26 05:56:06 -0700 (Wed, 26 Oct 2011)
New Revision: 9153
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.
Also, removed unused type Fl_XMap and global variable fl_current_xmap.
Modified:
branches/branch-3.0/include/fltk3/osx.h
branches/branch-3.0/src/fltk3/cocoa.mm
branches/branch-3.0/src/fltk3/cocoa_color.cxx
Modified: branches/branch-3.0/include/fltk3/osx.h
===================================================================
--- branches/branch-3.0/include/fltk3/osx.h 2011-10-26 12:42:41 UTC (rev
9152)
+++ branches/branch-3.0/include/fltk3/osx.h 2011-10-26 12:56:06 UTC (rev
9153)
@@ -150,10 +150,6 @@
bool subwindow;
};
-extern struct Fl_XMap {
- RGBColor rgb;
- ulong pen;
-} *fl_current_xmap;
extern Window fl_window;
#endif // FL_LIBRARY || FLTK3_INTERNALS
Modified: branches/branch-3.0/src/fltk3/cocoa.mm
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa.mm 2011-10-26 12:42:41 UTC (rev
9152)
+++ branches/branch-3.0/src/fltk3/cocoa.mm 2011-10-26 12:56:06 UTC (rev
9153)
@@ -2826,6 +2826,7 @@
}
- (void)showPanel;
- (void)printPanel;
+- (void)closePanel:(NSNotification *)notif;
@end
@implementation FLaboutItemTarget
- (void)showPanel
@@ -2837,7 +2838,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 <fltk3/PostScript.h>
- (void)printPanel
{
Modified: branches/branch-3.0/src/fltk3/cocoa_color.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa_color.cxx 2011-10-26 12:42:41 UTC
(rev 9152)
+++ branches/branch-3.0/src/fltk3/cocoa_color.cxx 2011-10-26 12:56:06 UTC
(rev 9153)
@@ -42,11 +42,6 @@
#include "cmap.h" // this is a file produced by "cmap.cxx":
};
-// Translations to mac data structures:
-Fl_XMap fl_xmap[256];
-
-Fl_XMap* fl_current_xmap;
-
void fltk3::QuartzGraphicsDriver::color(fltk3::Color i) {
fltk3::GraphicsDriver::color(i);
int index;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit