Detecting the stack that have the mouse pointer

Scott Rossi scott at tactilemedia.com
Mon Apr 4 13:23:37 EDT 2005


Recently, Alejandro Tejada  wrote:

> I have a mousemove handler in
> a frontscript. 
> This mousemove handler puts the X,Y
> position in the message box and i want
> to know the mode of the stack over which
> the mouse pointer is.
> Toplevel stacks have a mode of 1
> palettes, modeless stacks and modal stack
> have different numbers.
> 
> for example:
> 
> i expect that when i move the mouse over
> a stack, appears in the message box:
> 
> 35,79 stack "mytoplevelstack" mode 1
> 
> or
> 
> 10,10 stack "myCustomstack" mode 2
> 
> How could i do this without clicking on
> the stack?

One way is to replace your mouseMove handler with a looping script that
checks every line in the openStacks.  Something like:

 on checkMode
  put the openStacks into tList
  repeat for each line L in tList
    if within(stack L,the screenMouseLoc) then put the mode of stack L
  end repeat
  send "checkMode" to me in 50 millisecs
 end checkMode

You also might be able to limit the check to a few stacks.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list