win32 topstack problem

Richard Gaskin ambassador at fourthworld.com
Mon Feb 2 14:38:24 EST 2004


Alex Rice wrote:

> Has anyone see problem similar to this?
> 
> Background:
> 
> I navigate between mainstack and substack by this code:
> 
> go card x of stack "sub" as toplevel -- a substack
> hide me -- the mainstack
> 
> (I hide the previous stack *afte*r opening the next stack so there is
> no empty space flashing between stacks. Also using "go ... in the
> window of ..." is not an option at this point- I would have to rewrite
> too much code.)
> 
> In the preOpenStack card handler of stack "sub", a script runs this
> code:
> 
> send xxxxyyyy to the current card of the topstack
> 
> (The script is run by an external XCMD, if that matters.)
> 
> Here is the problem:
> 
> On Mac OS X, the message xxxxyyyy is sent to card x of stack "sub"
> On Win32, the message xxxxyyyy is sent to somewhere else, I guess to
> the current card of the  mainstack. Here is a workaround:
> 
> go card x of stack "sub" as toplevel -- a substack
> wait 1 tick with messages -- wait for "topstack" to be correct
> hide me -- the mainstack
> 
> So it seems there is some kind of race condition where "the topstack"
> is not necessarily known?

The preOpenStack message is sent before the card is drawn, while the
topStack returns the value of the topmost visible stack with the lowest
mode.

This behavior should be the same across platforms, so I appreciate your
Bugzilla report of any platform-specific deviance.

Changing your handler from preOpenStack to openStack may resolve the issue.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list