Skip to content

Instantly share code, notes, and snippets.

@klaaspieter
Created June 17, 2010 07:37
Show Gist options
  • Save klaaspieter/441805 to your computer and use it in GitHub Desktop.
Save klaaspieter/441805 to your computer and use it in GitHub Desktop.
- (void)loadWindow
{
[super loadWindow];
// It's impossible to load a CPDocModalWindow from nib, we work around this by
// checking if the loaded window has the correct stylemask, if not we create a new window
// with the same size as the old one and set the content view reference to that of the old window
if ([_window styleMask] !== CPDocModalWindowMask)
{
var contentView = [_window contentView];
_window = [[CPWindow alloc] initWithContentRect:[[_window contentView] bounds] styleMask:CPDocModalWindowMask];
[_window setContentView:contentView];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment