Splash screen code
Splash screen code
- Subject: Splash screen code
- From: April Gendill <email@hidden>
- Date: Mon, 22 Dec 2003 00:08:05 -0700
Umm here's my code on the splash screen thing:
this is in the awake from nib in the main app controller.
loadWindow = [[NSWindow alloc] initWithContentRect:[loadWindow
frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:YES];
[loadWindow setContentView:theView];
[loadWindow setHasShadow:YES];
[theImage setImage:[NSImage imageNamed:@"popup.tif"]];
[theImage setTarget:loadWindow];
[theImage setAction:@selector(orderOut:)];
[loadWindow makeFirstResponder:theImage];
[loadWindow setLevel:NSStatusWindowLevel];
[loadWindow setIgnoresMouseEvents:NO];
[theImage setNeedsDisplay];
[loadWindow makeKeyAndOrderFront:self];
the subclass of NSWindow that i did is virtually c&p from the examples
from apple
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:NO];
[self setBackgroundColor: [NSColor clearColor]];
[self setLevel: NSStatusWindowLevel];
[self setAlphaValue:1.0];
[self setOpaque:NO];
[self setHasShadow: YES];
return self;
}
-(void)dealloc{
[super dealloc];
}
- (BOOL) canBecomeKeyWindow
{
return YES;
}
- (void)mouseDown:(NSEvent *)theEvent
{
NSRect windowFrame = [self frame];
initialLocation = [self convertBaseToScreen:[theEvent
locationInWindow]];
initialLocation.x -= windowFrame.origin.x;
initialLocation.y -= windowFrame.origin.y;
[[NSNotificationCenter defaultCenter]
postNotificationName:LoadWindowClosed object:self];
}
in IB I have connected up the loadWindow outlet in the main controller.
I have also connected the view and image.
What am I missing????
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.