X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/396b37294a8c37739d71535783ae5c54d5f12f70..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/iphone/nonownedwnd.mm diff --git a/src/osx/iphone/nonownedwnd.mm b/src/osx/iphone/nonownedwnd.mm index d57dc018bd..1be798fb72 100644 --- a/src/osx/iphone/nonownedwnd.mm +++ b/src/osx/iphone/nonownedwnd.mm @@ -352,7 +352,15 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, true ); impl->InstallEventHandler(); - [toplevelwindow addSubview:contentview]; + + if ([toplevelwindow respondsToSelector:@selector(setRootViewController:)]) + { + toplevelwindow.rootViewController = controller; + } + else + { + [toplevelwindow addSubview:contentview]; + } return impl; } @@ -396,6 +404,21 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) return YES; } +// iOS 6 support, right now unconditionally supporting all orientations, TODO use a orientation mask + +-(BOOL)shouldAutorotate +{ + return YES; +} + + - (NSUInteger)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskAll; +} + + + + - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] );