• 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
Re: SplashScreen & Content view problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SplashScreen & Content view problem


  • Subject: Re: SplashScreen & Content view problem
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 1 Aug 2006 15:13:19 -0400


Have you read the documentation for NSImageView carefully, you would have seen -setImageAlignment: ...


Also, in your second block, you're initializing a view using -init instead of -initWithFrame: ... this is wrong and likely to cause problems if you don't break the habit now.

--
I.S.


On Aug 1, 2006, at 3:07 PM, Bobby B wrote:

Hello guys;

I'm making a splash screen for my app (yes, it does need one, because
it takes a while to load and for it's specific application.)  I
figured out well enough how to make a window and add a picture to it,
but the problem is the picture is always centered.  I want the picture
in the bottom-left corner (0,0)..  I can't quite seem to figure it
out.  I've tried every combination of putting [ -setBounds], [
-setOrigin], etc.

I'd appreciate any hints you could give me!

The BorderlessWindow just returns a borderless window, that can become
keyview, etc.

Here is the code:

// Set up the window
NSRect theScreenFrame = [[NSScreen mainScreen] frame];
BorderlessWindow *splashWindow = [[BorderlessWindow alloc] init];
[splashWindow setBackgroundColor:[NSColor blackColor]];
[splashWindow setFrame:theScreenFrame display: YES animate: YES];
[splashWindow setHasShadow: NO];
[splashWindow makeKeyAndOrderFront: self];

// Set up the image
NSImage *splashImage = [[NSImage alloc] initWithContentsOfFile:
[[NSBundle mainBundle] pathForImageResource:@"AMP_SplashScreen.png"]];
NSImageView *splashView = [[NSImageView alloc] init];
[splashView setImage: splashImage];

// And display it
[splashWindow setContentView: splashView];
[splashWindow display];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Re: SplashScreen & Content view problem
      • From: "Bobby B" <email@hidden>
References: 
 >SplashScreen & Content view problem (From: "Bobby B" <email@hidden>)

  • Prev by Date: What is Interface Builder doing behind the scenes?
  • Next by Date: Re: Re: SplashScreen & Content view problem
  • Previous by thread: SplashScreen & Content view problem
  • Next by thread: Re: Re: SplashScreen & Content view problem
  • Index(es):
    • Date
    • Thread