]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSWindow.mm
wxMac apparently doesn't send EVT_SHOW, so just use wx.CallAfter instead
[wxWidgets.git] / src / cocoa / NSWindow.mm
index c2df1cd5e6c26408ac33de7c4a5223814855dd95..792f701b1911049f545b70f11728d6e86d8de7b9 100644 (file)
@@ -1,10 +1,10 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/NSWindow.mm
+// Name:        src/cocoa/NSWindow.mm
 // Purpose:     wxCocoaNSWindow
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/03/16
-// RCS-ID:      $Id:
+// RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
 // Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
@@ -193,12 +193,22 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win)
 {
 }
 
+- (BOOL)canBecomeKeyWindow;
 - (BOOL)canBecomeMainWindow;
 @end // wxPoserNSwindow
 
 WX_IMPLEMENT_POSER(wxPoserNSWindow);
 @implementation wxPoserNSWindow : NSWindow
 
+- (BOOL)canBecomeKeyWindow
+{
+    bool canBecome = false;
+    wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self);
+    if(!tlw || !tlw->Cocoa_canBecomeKeyWindow(canBecome))
+        canBecome = [super canBecomeKeyWindow];
+    return canBecome;
+}
+
 - (BOOL)canBecomeMainWindow
 {
     bool canBecome = false;
@@ -209,4 +219,3 @@ WX_IMPLEMENT_POSER(wxPoserNSWindow);
 }
 
 @end // implementation wxPoserNSWindow
-