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/archive%40mail-archive.com

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

Reply via email to