I am trying to write a script (Win32 2.3.1) that will close a mainstack and
all of its substacks so I can open a fresh copy of the mainstack.  Some of
the substacks are palettes, some have no decorations and the rest are
topLevel.  I have placed my script in the closeStack handler of the
mainStack ("Low").  I have enabled "Destroy window on close" and "Destroy
stack on close" for the mainStack and its substacks to make sure that when
it closes no vestiges of the old stack are left.  It looks like this
(debugging "waits" are sprinkled throughout):

on closeStack
  if the short name of this stack is not "Low" then exit closeStack
  put "Closing Low stack"
  wait 2 seconds
  repeat for each line stkname in the subStacks of stack "Low"
    put the mode of stack stkname into stkmode
    put "Mode of " & stkname && "is" && stkmode
    wait for 2 seconds
    switch stkmode
    case 0
      # Unopened stack
      wait for 2 seconds
      break
    case 1
      close stack stkname
      break
    case 4
      lock screen
      set the style of stack stkname to none
      toplevel stkname
      hide stack stkname
      close stack stkname
      unlock screen
      break
    default
      wait for 2 seconds
    end switch
  end repeat
end closeStack 

Even with this script some times some of the stacks remain opened as
determined by the openStacks property.  It seems that stacks with no
decorations and palette stacks need some kind of special handling.  Any
suggestions as to what I can try would be appreciated.

Larry Huisingh


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to