Showing groups on mouseOver

Curry curry at kagi.com
Thu Feb 28 18:41:01 EST 2002


I have groups of controls on a card that are hidden when the card is doing
its thing, so that the user can focus entirely on the action without any
distracting elements. However, the control groups can be shown again during
the action by temporarily by passing the mouse over them.

After much experimenting, I found that (I think) it's necessary to use an
invisible button behind each group (which is the size of the group) to catch
the mouseEnter's to show the group. (I tried having the group catch the
message, leaving the group visible all the time and only hiding the
controls, but groups don't seem to catch those messages, even if they are
opaque.) 

I originally had the button and the group both catch mouseLeave's to hide
the group, and it worked well generally, but there were always situations
where the mouse, if moved correctly, could be slipped out without the group
or the button catching the mouseLeave, so the group would remain visible.

(Yes, all the controls did pass the messages to the group. I checked and
tried it extensively, so of course I could have made a mistake, but I'm
pretty sure I didn't. If groups were near the edge of the window it seemed
that it was easier to make it fail.)

Finally I got perfection by using the invisible button to catch the
mouseEnter and hide the group, and thereafter using send..in to check every
second or two with the mouseLoc until the group should be hidden. This works
fine, but just wanted to compare notes since it seemed like a difficult
behavior to perfect.

Curry Kenworthy





More information about the Use-livecode mailing list