]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Update OpenVMS compile support
[wxWidgets.git] / src / osx / cocoa / nonownedwnd.mm
index ec7fcf12c1db53541532e13b5a5d9d2a5e741ac2..6e270ee8266b5ec19e1c84ccd44d4e7e13042c60 100644 (file)
@@ -137,10 +137,26 @@ wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
     return NO;
 }
 
-- (NSSize)windowWillResize:(NSWindow *)window
+- (NSSize)windowWillResize:(NSWindow *)win
                     toSize:(NSSize)proposedFrameSize
 {
-    // todo
+    NSRect frame = [win frame];
+    wxRect wxframe = wxFromNSRect( NULL, frame );
+    wxframe.SetWidth( proposedFrameSize.width );
+    wxframe.SetHeight( proposedFrameSize.height );
+    wxNSWindow* window = (wxNSWindow*) win;
+    wxNonOwnedWindowCocoaImpl* windowimpl = [window implementation];
+    if ( windowimpl )
+    {
+        wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
+        if ( wxpeer )
+        {
+            wxpeer->HandleResizing( 0, &wxframe );
+            NSSize newSize = NSMakeSize(wxframe.GetWidth(), wxframe.GetHeight());
+            return newSize;
+        }
+    }
+
     return proposedFrameSize;
 }
 
@@ -235,7 +251,7 @@ long style, long extraStyle, const wxString& name )
     else
         m_macWindow = [wxNSWindow alloc];
     
-    CGWindowLevel level = kCGNormalWindowLevelKey;
+    CGWindowLevel level = kCGNormalWindowLevel;
     
     if ( style & wxFRAME_TOOL_WINDOW )
     {