Skip navigation.
 
mlRe: SplashScreen & Content view problem
FROM : I. Savant
DATE : Tue Aug 01 21:28:25 2006

Just remember to get out of the habit of initializing views with -
init. In your case, since you're replacing the existing (empty) 
content view of your splash window with the image view, you could say:

NSImageView * splashView = [[NSImageView alloc] initWithFrame:
[[splashWindow contentView] frame]];

--
I.S.


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

> Hello again :)
>
> Sigh..  That did the trick!  It never even occured to me that it would
> be the alignment.  I'm just starting with building the UI elements
> outside of IB.  There's always so much more to learn!
>
> Thank you,
> Bobby
>
> On 8/1/06, I. Savant <<email_removed>> wrote:

>>
>>    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_removed>)
>> > Help/Unsubscribe/Update your Subscription:
>> > http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
>> > 40gmail.com
>> >
>> > This email sent to <email_removed>
>>
>>

Related mailsAuthorDate
mlSplashScreen & Content view problem Bobby B Aug 1, 21:07
mlRe: SplashScreen & Content view problem I. Savant Aug 1, 21:13
mlRe: Re: SplashScreen & Content view problem Bobby B Aug 1, 21:20
mlRe: SplashScreen & Content view problem I. Savant Aug 1, 21:28
mlRe: Re: SplashScreen & Content view problem Shawn Erickson Aug 1, 21:32