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!
When I hover my house over an object (I am guessing the object would have a 'mouseWithin' handler), I would like for a small image to appear...sort of like a tooltip. There are approximately 20 different objects on one card each needing a separate image 'tooltip'.
That's exactly what I did. I have a sub stack with multiple cards. Each card contains an image. Back on the main stack, each object contains mouseEnter and mouseLeave handlers with the mouseEnter handler pointing to a particular card of the sub stack.
Hi Jon,
You may use a group with an image or just one image which is visible on mouseenter at the loc of your object or where you want.
You may change image filename or text according to your object
Best regards
Jean-Marc
on mouseMove
local tObj
put the short name the mouseControl into tObj
if exists(img tObj of stack "iconStack") then
[show the stack with the correct image]
end if
end mouseMove
Gets a bit more complex if you have grouped objects, but at least every control will not need a mouseEnter, mouseLeave command.
on mouseMove x,y
if the mouseloc is within the rect of btn 1 then show img 1 at (x + 20) & "," & y
end mouseMove
You can create a schema where the name (or number or whatever property you want) of the target is used instead of the explicit reference above, and show the image of choice, hiding all the others.
1. by MouseEnter script behavior and mouseenter in cd script
2. by Mousemove script behavior and mouseenter in cd script
Both need a grc "TrapMouseenter" which send mouseenter catched by mouseenter cd script to hide the image.
The "image tooltip" get the text of an hidden image (one for each btn).
You may set the behavior of btn with radio buttons.
Best
Jean-Marc