+ // If we have the additional toolbar/statbar view, then the
+ // default replaceSubview will work. Otherwise, the old view
+ // should be the content view and should be replaced that way
+ if(m_frameNSView)
+ wxWindow::CocoaReplaceView(oldView, newView);
+ else
+ wxTopLevelWindow::CocoaReplaceView(oldView, newView);
+}
+
+void wxFrame::UpdateFrameNSView()
+{
+ if(!m_frameNSView)
+ {
+ m_frameNSView = [[NSView alloc] initWithFrame:[[m_cocoaNSWindow contentView] frame]];
+ [m_cocoaNSWindow setContentView: m_frameNSView];
+ [m_frameNSView addSubview:m_cocoaNSView];
+ }
+ NSRect frameRect = [m_frameNSView frame];
+ float tbarheight = 0.0;
+#if wxUSE_TOOLBAR
+ if(m_frameToolBar)
+ {
+ NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
+ // If the toolbar doesn't have a superview then set it to our
+ // content view.
+ if(![tbarNSView superview])
+ [m_frameNSView addSubview: tbarNSView];
+ // Do this after addSubView so that SetSize can work
+ m_frameToolBar->SetSize(m_frameToolBar->DoGetBestSize());
+ NSRect tbarRect = [tbarNSView frame];
+ tbarRect.size.width = frameRect.size.width;
+ tbarRect.origin.x = 0.0;
+ tbarRect.origin.y = frameRect.size.height - tbarRect.size.height;
+ [tbarNSView setFrame:tbarRect];
+ // width expands, bottom margin expands
+ [tbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
+ tbarheight = tbarRect.size.height;
+ }
+#endif //wxUSE_TOOLBAR
+ float sbarheight = 0.0;
+ if(m_frameStatusBar)