open a substack in an opencard handler

Mark Wieder mwieder at ahsoftware.net
Mon Jul 29 19:19:56 EDT 2013


Martin-

Monday, July 29, 2013, 3:07:57 PM, you wrote:

> I assume the problem is that when the opencard message ends the stack with
> the card with that handler becomes the active stack and moves to the front.

Yes, that's exactly what's going on. You're not giving the openCard
handler in the mainstack a chance to finish, and when you finally give
it control again after the two second wait, the card on the mainstack
can finally open (and come to the front as a side-effect). Try putting
the substack commands in a separate handler and send it in time:

on openCard
  -- do stuff here
  send "showSubStack" to me in 1 millisecond
end openCard

on showSubStack
  show stack "window2"
  go stack "window2"
end showSubStack


-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list