Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported Configuration Error in Cocoa (Xcode )

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 ?

like image 520
Aug Avatar asked Sep 14 '12 11:09

Aug


2 Answers

  1. You just need to move the window in the sizing inspector in IB.

  2. This SO question should answer that.

like image 136
trojanfoe Avatar answered Sep 23 '22 13:09

trojanfoe


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 ! enter image description here

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]; }

enter image description here

like image 25
Aug Avatar answered Sep 22 '22 13:09

Aug