Trouble setting a substack to topstack Help please.

Dave Herndon herndogy at
Fri Oct 20 12:47:01 EDT 2006

Situation.  Three stacks.  A MainStack and two SubStacks.  MainStack queries data from the dabase on start up.  Substack1 is a small stack that is hidden.  It is called from the mainstack with the modal SubStack1, show SubStack1 commands. It pops up data is then manipulated and then re-inserted back into the database.  Before Substack1 is hidden it calls a handler in the mainstack to refresh the main stack's screen with another database query.  Everything works sweet.  
  Now look at a similar situation.  Mainstack calls substack2 with the modal substack2, show substack2 commands.  Substack2 is a bit larger window that pops on top of the mainstack and rup runs a different query to show a different view of the same data.  Substack2 now calls substack1 with the modal substack1, show substack1 commands because it wants to edit the data.  It pops up fine and data is re-inserted into the database. Now comes the problem...  I cant get the screen in substack2 to refresh with the same method as the mainstack.  Sending mouseup to the refresh button in substack2 or calling a handler in the stack script of substack2 cant be done because the topstack reverts back to the mainstack as soon as substack1 is hidden. Setting the topstack to substack2 only works if i use the path 
  ( set the topstack to "substack2 of stack mainstack.rev" )
  which is immediatly followed by a message that says "before you open "mainstack.rev" what do you want to do with "mainstack" ?  Purge,save or cancel.  I havent had any luck with placing the refresh screen handler in the mainstacks script either.  Any ideas.  I have been farting around with this from every angle for about 4 hours.  If you click on the refresh button in substack2 after every change it works fine but I'm sure their is a way to get this to refresh automaticly.  Also I have a database dissconect script in the mainstack and when I close the stack it gets executed three times.  One time for each one of the three stacks.  This causes an error.

More information about the Use-livecode mailing list