I’ve got a nice little Obj-C code (which I know nothing about and simpy cut and pasted) to make my app full screen-ish, but the trouble here is that you can still click on the window and it will come to the front, blocking all the other windows and just being generally unpleasant. Does anyone here know how to remedy said situation? Another much less important problem is that if you Exposé it, there’s a nice big black square floating around. The first problem is much more important though. Anyone have any ideas? Here’s the code:
#import "FullScreen.h"
NSWindow *fsWindow;
@implementation NSApplication (ASKAFullScreen)
- (NSWindow *)beginFullScreen
{ fsWindow = [
[NSWindow alloc]
initWithContentRect:[[NSScreen mainScreen] frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
NSView *fsView=[[NSView alloc] initWithFrame:[fsWindow frame]];
[fsWindow setContentView:fsView];
NSImageView *fsImage = [[NSImageView alloc] initWithFrame:[fsView frame]];
[fsView addSubview:fsImage];
[fsWindow setBackgroundColor:[NSColor blackColor]];
[NSMenu setMenuBarVisible:1];
[fsWindow makeKeyAndOrderFront];
return fsWindow;
}
- (void)endFullScreen
{ [NSMenu setMenuBarVisible:1];
[fsWindow close];
}
- (void)hideMenuBar
{ [NSMenu setMenuBarVisible:0];
}
- (void)showMenuBar
{ [NSMenu setMenuBarVisible:1];
}
@end
Also, 50th post! Gold star for me!