A Tidbit of Objective-C Help

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!

anyway there are a couple methods in NSWindow’s repetoire that might cover you. For setting it to be behind windows even when clicked you could have on became key/main hanlders that set it behind all the windows again like so:

call method “orderBack:” of theWindow with parameter theWindow

or maybe you could /play/ with “setLevel:” and values not mentioned in the constants lists… (I take no responsibility for what may occur however)… as for hiding it from exposé… hmmm… the thoughts I had conflict with the last set of advice (ie. make it an NSPanel instead… but that is for placing it above other things, and invisible when a different application is current…

But since the window is created by the Obj-C code, I can’t attatch any applescripts to it I think. Also, I don’t know any C, so I have no idea what you’re talking about with the set level.