a little message path issue

Chris Sheffield revlist at cableone.net
Fri May 6 18:33:38 EDT 2005


Dear List,

Okay, let's see if I can explain this.

I have a group that contains an image as a background and several  
custom buttons placed on the top of it.  The background image has a  
"stick out tab sort of thing" on it's left side.  The idea is to  
place the group on the right side of the window so that only the tab  
is showing.  When the user moves the mouse over that tab, I want the  
group to slide out revealing the buttons.  When the user moves the  
mouse out of the group, I want it to slide back so that only the tab  
is visible again.  Okay, so far so good.

So I place mouseEnter (to slide the button panel out) and mouseLeave  
(to slide it back in) handlers in the group's script.  Worked great  
until I placed my buttons in the group.  This is what happens now.  I  
move the cursor over the tab.  The group slides out fine.  But as I  
move up and down over my buttons, mouseEnter and mouseLeave messages  
get sent, including those to the background image, which triggers my  
moving action.  So if I mouseEnter one of my buttons, I mouseLeave my  
background image, which slides the group back.  That's not the  
behavior I want.  As long as I'm within the group, I want it to be  
slid out, even as I'm moving up and down over the buttons.

Does that make sense?  Should I be handling different messages  
besides mouseEnter and mouseLeave?  A mouseWithin perhaps?  I'm kind  
of stuck.  Can someone help?

Thanks,
Chris Sheffield
Read Naturally


P.S.  Here's my group's script:

on mouseEnter
     if "ButtonBar" is in the name of the target then
         move me to 580,241
     end if
end mouseEnter

on mouseLeave
     if "ButtonBar" is in the name of the target then
         move me to 668,241
     end if
end mouseLeave


More information about the use-livecode mailing list