effective topstack

Wilhelm Sanke sanke at hrz.uni-kassel.de
Mon May 26 14:36:00 EDT 2003


The "topstack" and "topwindow" functions return the frontmost open stack
with the lowest mode, which means, if you have two stacks open, the one
with "cantmodify" set to true will never be the topstack even if it is
visually in the frontmost window.

Is there another function or way to determine the "effective" topstack
irrespective of the mode the stack has?

As a workaround it is possible to use the "the stacks" and the
undocumented "the windows" functions, where "the stacks" returns a list
of long filenames and "the windows" returns a list of short stacknames,
but both lists include all stacks of the environment that are being used
at the moment.
When the environment stacks are then filtered out, the stack in the
first line of the remaining list is the real "effective topstack".

This workaround approach has a drawback, because both the "the stacks"
and "the windows" functions have unexpected consequences; for instance
when you use a modal dialog after having run one of the two functions
the dialog window will not close until the portion of the script
triggered by the dialog  is completed (assume a search script with a
larger number of repeat loops). It will not close despite the fact that
a "wait x milliseconds" was added in the next line, which usually forces
a modal dialog to close instantly even when the following script is
still running. This happens often on Windows.

Anybody out there who knows another and a quick way to determine the
"effective" topstack?

Regards,

Wilhelm Sanke




More information about the use-livecode mailing list