Re: Splash screen
Re: Splash screen
- Subject: Re: Splash screen
- From: Marcel Bresink <email@hidden>
- Date: Thu, 3 May 2001 12:20:47 +0200
Am Donnerstag, 3. Mai 2001 um 05:00 schrieb email@hidden:
- My splash window does come up, but it is not key. The user can make
it key by clicking on it. The only way I could find to make it key is
to have a runModalSession loop instead of runModalForWindow and send
the makeKeyAndOrderFront: message to my window inside the loop. That
seems a bit brute force and the documentation says I'm not supposed to
call makeKeyAndOrderFront: on the window.
How can I ensure that my window is key?
Well, as the documentation says, you shouldn't... ;-)
Imagine the user is typing some text in an editor window while
starting your program. (I'm doing this very often, especially
on slow machines.) When the splash window becomes key, the editor
loses its key status and the user's input is now sent to your
application. The user will be ... disappointed.
- After dismissing the splash screen, the document window behind never
becomes key. Switching app, clicking on the window, etc has no effect.
Very unfortunate.
This happens when you don't stop or abort the modal session. The event
filtering that was responsible for making the window modal is still
active, so the other window does not receive events. A stopModal message
will help, but it's not a good idea to make a splash window modal anyway.
- An untitled document still gets created in the back of my splash
screen (or a document gets opened if a user launched the app by
double-clicking on one).
How can I delay this till after the user has dismissed the splash
screen?
If it's really a splash screen (and not a warning or license panel),
it's not user-friendly when the window doesn't dismiss itself.
- I couldn't find a way to create a window that looks like a splash
screen (i.e. no title bar). What's the trick?
Initialize the window yourself with
initWithContentRect:styleMask:backing:defer:.
Use a style mask that includes the NSBorderlessWindowMask constant. If
you want
to create the window contents in InterfaceBuilder, swap the content view
of
the IB-defined window with the content view of the window you create
programatically at runtime.
- The Size panel of the inspector in IB shows that my window is springy
on all four sides, yet it is not centered on the screen. How can I make
sure that it is centered?
The springs control how the window relocates itself when it is opened
on a particular screen in relation to the position you defined in IB.
To make sure it's always exactly centered, send a "center" message to
the window before calling orderFront:.
Marcel
--
Dr. Marcel Bresink, Ringstr. 21, 56630 Kretz, Germany
Fon: +49-2632-953150 Fax: -953151
http://www.bresink.de/