Re: Can't get window to come to front in awakeFromNib method
Re: Can't get window to come to front in awakeFromNib method
- Subject: Re: Can't get window to come to front in awakeFromNib method
- From: Shawn Erickson <email@hidden>
- Date: Sat, 6 Dec 2003 10:00:31 -0800
On Dec 6, 2003, at 9:41 AM, Kurt Marek wrote:
I have a setup window that I want to come to the front when an app is
launched for the first time. I thought this would be fairly easy with
the following code:
if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"libraryLocation"]==nil) {
[setupWindow makeKeyAndOrderFront:self];
}
This code is in the awakeFromNib method of my main controller. The
window appears on screen and is made key (it's menu bar text is black),
but it stays behind the main window of my app. What am I doing wrong
here?
Try doing this in applicationDidFinishLaunching: [1] instead.
Your main window is likely marked to be automatically displayed and it
is loading up after your controller.
-Shawn
[1]
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSApplication.html#//apple_ref/doc/
uid/20000012/CACBHCEH
_______________________________________________
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.