Reputation: 101
Please help me. I set frame to the window like this:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
[window makeKeyWindow];
[window setFrame:NSMakeRect(0, 0, 1024, 768) display:YES];
[window setBackgroundColor:[NSColor clearColor]];
[window center];
}
But real window size: width = 1024, height = 620. I think because my screen size (1280x720).
So, when [window setContentView:myView]
, myView is disable a part.
I can't solve this problem. Please help me solve this.
Thanks.
Upvotes: 0
Views: 395
Reputation: 150565
If you want to show your window at the maximum size, have a look at NSWindow's -zoom:
method
Upvotes: 0
Reputation: 36143
Size your content view to fit the space available using -[NSWindow contentRectForFrameRect:]
. You should also consider sizing your window's frame to fit the available space, as well, such as by using -[NSScreen visibleFrame]
. Both the Dock and the menu bar eat some space, so you should not expect to have the full screen size available to your application.
Upvotes: 1