[futurebasic] Re: Apple Events

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1998 : Group Archive : Group : All Groups

From: Mars Saxman <marssaxman@...>
Date: Mon, 3 Aug 98 18:09:37 -0800
>Jonathan and Deep have suggested that I bring my app to the front when I
>receive the activate event and, in fact, this is what the Scriptable Text
>Editor does. I can bypass my splash screen when I'm not the frontmost app.
>and do this - it sounds good to me but I don't understand why my splash
>screen won't time out using the code above.

Ahhh. Your splash screen is probably a modal window. The Event and Layer 
managers do funny things when an app's frontmost window is modal. (You 
can switch in, but you can't switch out, for example.) It's entirely 
possible that the Event Manager simply stops sending you events while a 
modal window is up, until the user activates your app manually.

Just to see what happens, try making the splash window non-modal. My 
guess is that your app will magically begin handling events in the way it 
was "supposed" to.

Other ideas: If you poke a value at a certain offset from the EVENT 
function, you can convince HANDLEEVENTS to call WaitNextEvent instead of 
GetNextEvent. Have you done this? I have a hunch that using WNE instead 
of GNE might solve the problem.

Aside from that, all I can think of are 1) only open the splash screen if 
your app is in the foreground or 2) install a Time Manager task which 
goes off after three seconds and brings your app to the foreground, thus 
allowing events to continue processing.

-Mars