Hey John,

Does this help? I am hiding the dock elsewhere with SetSystemUIMode.

// Calculate the size to make the new screen.
NSRect fullScreenRect = [[[NSScreen screens] objectAtIndex:0] frame];
// Uses the menu bar screen. -mainWindow has problems.

fullScreenRect.size.height -= [[NSApp mainMenu] menuBarHeight];
                
// Open the full-screen window.
_fullScreenWindow = [[FullScreenWindow alloc] initWithContentRect:fullScreenRect
                                                                        
styleMask:NSBorderlessWindowMask
                                                                        
backing:NSBackingStoreBuffered defer:NO];               
                if(_fullScreenWindow != nil) {
                        [_fullScreenWindow setContentView:[[self window] 
contentView]];
                        [_fullScreenWindow makeKeyAndOrderFront:nil];
                        // Hide (but don't close) the small-screen window.
                        [[self window] orderOut:nil];
                }


On Wed, Feb 4, 2009 at 5:51 AM, Jonathan Selander <jonat...@trodon.se> wrote:
> I have a program that goes into fullscreen like this:
>
> - (IBAction) goFullScreen:(id)sender
> {
>        // bort med dock och menubar, motverka tvångsavluta, alt+tab och
> utloggning
>        SetSystemUIMode(kUIModeAllHidden, kUIOptionDisableAppleMenu |
>                                        kUIOptionDisableForceQuit |
>                                        kUIOptionDisableProcessSwitch |
>                                        kUIOptionDisableSessionTerminate);
>
>    NSScreen *screen = [[contentView window] screen];
>    NSWindow *window = [[NSWindow alloc] initWithContentRect:[screen
>
>                                              frame]
>
>                       styleMask:NSBorderlessWindowMask
>
>                             backing:NSBackingStoreBuffered
>
>                               defer:NO
>
>                              screen:screen];
>    [contentView retain];
>    [contentView removeFromSuperview];
>    [window setContentView:contentView];
>    [contentView release];
>    [window makeKeyAndOrderFront:sender];
>    [NSCursor setHiddenUntilMouseMoves:YES];
>
>        [fullScreenButton removeFromSuperview];
>        [mainWindow close];
>
>        [self _reloadRenderers];
> }
>
> This works fine if I bind a button to call the function after the program
> has loaded, but I need it to enter fullscreen when the application is
> launched, and when i do that an empty window is put in front (I think it's
> mainWindow). How can I prevent this from happening when calling this
> function when the application
> launches?_______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/agersonl%40gmail.com
>
> This email sent to agers...@gmail.com
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to