use-revolution Digest, Vol 5, Issue 16
Martin Baxter
martin at harbourtown.co.uk
Tue Feb 3 10:50:10 EST 2004
>I'd like to chime in for a second, as Martin is
>correct in assuming that this runs off into an
>infinite loop : if the substack doesn't have an
>iconifyStack handler of its own, the mainstack will
>get the same message again.
>So the solution is probably along the lines of :
>--
>local sBusyIconifying
>on iconifyStack
> -- exit if we're already iconifying
> if sBusyIconifying is true
> then exit iconifyStack
> else put true into sBusyIconifying
> -- now that we've set the flag
> -- proceed by iconifying the other stacks
> put the openstacks into tvar
> put the short name of this stack into myname
> repeat for each line i in tvar
> if i <> myname then
> set the iconic of stack i to true
> end if
> end repeat
> -- clear the flag again for next time
> put false into sBusyIconfying
>end iconifystack
>--
>
>Hipe this helped,
>
>Jan Schenkel.
I also thought at first this would be true, but on investigation it seems
that iconifyStack and uniconifyStack are only sent when the *user*
minimises/maximises, and not when a script sets the iconic property.
So theoretically I think it ought to be safe just to set the iconic
property of each of the openstacks, without any of the anti-recursion stuff.
Martin
More information about the use-livecode
mailing list