Cocoa – Create nswindow in full screen mode

Is there a way to create NSWindow in full screen mode? NSWindow has ToggleFullscreen: selector, but it will create the window normally and animate it as a full screen version, which is not what I want. Other ways of doing this?
First find the screen size

NSRect screenRect; 
NSArray *screenArray = [NSScreen screens];
unsigned screenCount = [screenArray count];
unsigned index = 0;

for (index; index {
NSScreen *screen = [screenArray objectAtIndex: index];
screenRect = [screen visibleFrame];
}

screenRect contains the screen size, Now create a window and set the NSWindow size to the screen size.

unsigned int styleMask = NSTitledWindowMask 
| NSMiniaturizableWindowMask;


myWindow = [NSWindow alloc];
myWindow = [myWindow initWithContentRect: screenRect
styleMask: styleMask
backing: NSBackingStoreBuffered
defer: NO];
[myWindow setTitle: @"This is a test window"];

Is there a way to create NSWindow in full screen mode? NSWindow has ToggleFullscreen: selector, but it will create the window normally and animate it as a full screen version, which is not what I want. Other ways of doing this?

First find the screen size

NSRect screenRect;
NSArray *screenArray = [NSScreen screens] ;
unsigned screenCount = [screenArray count];
unsigned index = 0;

for (index; index {
NSScreen *screen = [screenArray objectAtIndex: index];
screenRect = [screen visibleFrame];
}

screenRect contains the screen size, now create a window and set the NSWindow size to the screen size .

unsigned int styleMask = NSTitledWindowMask 
| NSMiniaturizableWindowMask;

myWindow = [NSWindow alloc];
myWindow = [myWindow initWithContentRect: screenRect
styleMask: styleMask
backing: NSBackingStoreBuffered
defer: NO];
[myWindow setTitle: @"This is a test window"];

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 428 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.