-wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
-{
- UIWindow* toplevelwindow = now->GetWXWindow();
- CGRect frame = [toplevelwindow bounds];
- CGRect appframe = [[UIScreen mainScreen] applicationFrame];
-
- if ( now->GetWindowStyle() == wxDEFAULT_FRAME_STYLE )
- {
- double offset = appframe.origin.y;
- frame.origin.y += offset;
- frame.size.height -= offset;
- }
-
- wxUIContentView* contentview = [[wxUIContentView alloc] initWithFrame:frame];
- contentview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- wxUIContentViewController* controller = [[wxUIContentViewController alloc] init];
- controller.view = contentview;
-
- wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, true );
- impl->InstallEventHandler();
- [toplevelwindow addSubview:contentview];
- return impl;
-}
-