Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Hey! I am having an issue getting the mouseleave handler to work. I have a program where a field gets created in the middle of a line graphic and the field is supposed to show up when the mouse is over the graphic, and disappear when the mouseleaves. The field is only disappearing about half the time when I move the mouse off of the graphic. I used the message watcher and often the mouseleave command doesn't even appear. This is the graphic's code:
on mouseenter
if the commented of me is true then
put "Comment" & the short name of me into gCommentName
show field gCommentName
else if the commented of me is not true then
set the outerglow["color"]of me to "red"
set the outerglow["spread"] of me to 75
end if
end mouseenter
on mouseleave
if the commented of me is true then
put "Comment" & the short name of me into gCommentName
hide field gCommentName
else if the commented of me is not true then
set the outerglow of me to empty
end if
end mouseleave
This little stack works fine for me. I wonder if you're getting problems because of the mouse entering and leaving the graphic due to the field itself being shown or hidden which generates messages? I hit a recursion limit until I put a catch in for the mouseloc being within the field rect (inside the graphic) to stop a new mouseentter message being generated when the field disappeared and the mouse landed back in the graphic. If it's nothing to do with that, I'm not sure what you're facing.