diff options
| author | Manolo Gouy <Manolo> | 2011-10-26 12:42:41 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-10-26 12:42:41 +0000 |
| commit | 353f59a0ce663d3018e6d0d6edac08bb0783f5af (patch) | |
| tree | b0d9f949cc314756f0df5129da7db923013d37a6 /src | |
| parent | a1d63bc1580b40a7a0462a25b3f235dbbe57a540 (diff) | |
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.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index db2fbd70d..07dbaa6b3 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2825,6 +2825,7 @@ void Fl_X::set_cursor(Fl_Cursor c) } - (void)showPanel; - (void)printPanel; +- (void)closePanel:(NSNotification *)notif; @end @implementation FLaboutItemTarget - (void)showPanel @@ -2836,7 +2837,16 @@ void Fl_X::set_cursor(Fl_Cursor c) 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 { |
