Re: "Visible at Launch" again, with "least" example
Re: "Visible at Launch" again, with "least" example
- Subject: Re: "Visible at Launch" again, with "least" example
- From: PGM <email@hidden>
- Date: Tue, 3 Jul 2007 22:04:37 -0400
The NSDocument holds a webview that loads while the program loads.
The instance where I want to not show the window is when the user
needs to agree to a EULA. They can't have access to what's in the
NSDocument window until they've followed through that process.
I can, I suppose, rewrite it to not open an untitled window on
startup if they need to okay the EULA, then have the application
open the untitled window once they're beyond that, but it seems a
lot of extra code and potential failure points to correct a minor
error in behaviour.
How about using a modal panel to show the EULA? If you do this in
your document's windowControllerDidLoadNib method, the modal will
appear before the window appears (if I recall correctly).
A very ugly hack that I have used to make a document window disappear
before it is shown (without a flash) is by calling the following
method in windowControllerDidLoadNib.
-(void)disappear
{
//simply make the window fully transparent, then close document
[theWindow setAlphaValue:0.0];
[self close];
//make frontmost document the key window (does not work without
delay)
if([[NSApp orderedDocuments] count] > 0){
[[[[NSApp orderedDocuments] objectAtIndex:0] window]
performSelector:@selector(makeKeyAndOrderFront:) withObject:nil
afterDelay:0.001];
}
}
Hope this helps, Patrick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden