I need a full screen window with a lot of stuff in it , made by Cocoa Xcode 4. But there is a persistent warning: any time I try to resize the main window, I receive this warning ( code compiles well , but I am sure something will go wrong for users with small screens) this is the warning:
" Unsupported Configuration Content rectangle not entirely on screen with the menu bar ( May not be completely seen for all screen resolution and configurations)"
I have 2 questions:
1- what is best way to get rid of this warning (except using smaller window because the warning starts around 560 x 560 window size. I can't use such a small screen for that stuff)
2- How can I tell the program to open in full screen at the beginning ?
You just need to move the window in the sizing inspector in IB.
This SO question should answer that.
This is the code I could use under this link that thankfully "trojanfoe" let me know
Creating NSWindow in fullscreen mode
This is simplified code:
Remember that Cocoa does not make @synthesize in AppDelegate.m for default window. You need to add @synthesize window; manually
1- first we fill up screenRect with screen size 2- in size inspector set window position to " Fixed from Left" and make any offset needed you must payoff that offset in your code later ( Here I used 10 px of offset and 40px pay off. this resulted in exactly the same window size as Xcode !
3- add this code:
(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// set to open in full screen mode:
NSRect screenRect;
NSSize screenSize;
NSArray *screenArray = [NSScreen screens];
NSUInteger screenCount = [screenArray count];
for (NSUInteger index=0; index < screenCount; index++)
{
NSScreen *screen = [screenArray objectAtIndex: index]; screenRect = [screen visibleFrame];
}
// Now screenRect contain Screen size
screenSize.height= screenRect.size.height; screenSize.width= screenRect.size.width;
[window setContentSize:screenSize]; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With