• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Splash screen code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Splash screen code
      • From: lbland <email@hidden>
  • Prev by Date: Re: NSSearchField menu question
  • Next by Date: More Splash Screens
  • Previous by thread: Re: Getting started with Cocoa programming
  • Next by thread: Re: Splash screen code
  • Index(es):
    • Date
    • Thread