active stack

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Jul 8 08:26:48 EDT 2009


Hi Beat,

A failsafe method is to use the target in a frontscript.

on resumeStack
   showActiveStack
   -- do something with the result if you like
   pass resumeStack
end resumeStack

on preOpenStack
   showActiveStack
   -- do something with the result if you like
   pass preOpenStack
end preOpenstack

on showActiveStack theTarget
   if theTarget is empty then put long id of the target into theTarget
   put the short name of theTarget into myStack
   -- do something with myStack for example...
   if fld "Current Stack" of stack "Tiny Window" is not myStack then
     put myStack into fld "Current Stack" of stack "Tiny Window"
   end if
   return theTarget -- might be useful
end showActiveStack

-- Optionally, use the following to display the mouseStack
on mouseMove
   put long id of the target into myTarget
   put value(word (wordOffset("stack",myTarget) + 1) of myTarget) into  
myStackPath
   put long id of stack myStackPath into myStack
   -- you might also use "the long id of the mouseStack"
   -- but I believe that may not always work
   showActiveStack myStack
   -- do something with the result if you like
   pass preOpenStack
end mouseMove

(Please mind line wraps and typos).

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
Snapper Screen Recorder 2.1 http://snapper.economy-x-talk.com

If you sent me an e-mail before 21 June and haven't got a reply yet,  
please send me a reminder.

P.S. There is still the Dutch forum at <http://www.runrev.info/rrforum/>




On 8 jul 2009, at 11:44, Beat Cornaz wrote:

> I have a mainstack with several substacks. One of the substacks is a  
> tiny 'Indicator' and I have 'set the systemWindow of stack  
> "Indicator" to true'.
> So this stack floats above everything else. I have a button to go  
> from substack A to substack B. I have - go stack "B" - in the script  
> of the button.
> Clicking the button does make the substack "B" appear, but it has  
> not become the active stack. Only if I click in the substack "B" it  
> becomes the active stack (and gets the proper menu in Mac OSX).
> All works fine if I close the stack "Indicator".
> So, what commands do I use to make the stack appear and become the  
> active stack with the indicator open?. Toplevel does close the stack  
> first (i don't want that) and does not work either as I can remember.
>
> Thanks,
>
> Beat





More information about the use-livecode mailing list