Idle handlers and Text files

Devin Asay devin_asay at byu.edu
Tue Nov 6 11:00:12 EST 2007


On Nov 6, 2007, at 8:43 AM, Len Morgan wrote:

> I probably did confuse the "startup" message with preOpenStack  
> however, I put a simple debug message in my preOpenStack handler  
> (which is the STACK script) and it doesn't ever fire (when running  
> in the IDE).
>
> The last line of your response brings up a question though: Why  
> would you put a preOpenStack message in the first card instead of  
> the stack script?  This seems counterintuitive to me.

One good reason to do this is that when you make the stack into a  
standalone application, the stack in effect becomes the engine.  
Therefore, it is the final stop in the message hierarchy. That means  
that any substack or other stack that your standalone opens, if it  
doesn't have its own preOpenStack handler, will pass the preOpenStack  
message to the engine. You may not want the preOpenStack handler  
there to be activated for other stacks. On the other hand, if you put  
it in the first card's script, it will only run when the application  
is launched (because a stack by default opens to the first card.)
>
> For what it's worth, I am NOT starting up my stack by double  
> clicking on it.  I start up the Rev IDE first (w/ GLX2) and then  
> use File->Open Stack to pick my stack.
>
> Len Morgan
>
>
> Richard Gaskin wrote:
>> Len Morgan wrote:
>> > Along the lines of this discussion, I think someone mentioned  
>> that the
>> > preOpenStack message is NOT sent when you are using the IDE.  Is  
>> this
>> > true?
>>
>> I don't believe so; AFAIK the IDE does not prevent your stack from  
>> getting preOpenStack messages.  Perhaps you were thinking of startup?
>>
>> > If so, where can I put start-up code so that I set things up
>> > before an app gets going in both the IDE and a stand-alone?
>>
>> I do initialization from a preOpenStack handler in the card script  
>> of the first card of the stack file which will be made into a  
>> standalone.

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list