Tooltip bug
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller
Tooltip bug
If two adjacent and touching objects have the same tooltip, moving the mouse from one onto the other doesn't redraw the tooltip over the other object.
In my case, I have a whole column of buttons with no gaps between them, and if they have the same tooltip, I can wave the mouse over them and the tooltip remains at the first one I moused over. If they have different tooltips, then they follow the mouse just as one would expect.
Until this is fixed, does anyone know if there's something I can put into the mouseEnter handler that would provoke the tooltip to be redrawn?
In my case, I have a whole column of buttons with no gaps between them, and if they have the same tooltip, I can wave the mouse over them and the tooltip remains at the first one I moused over. If they have different tooltips, then they follow the mouse just as one would expect.
Until this is fixed, does anyone know if there's something I can put into the mouseEnter handler that would provoke the tooltip to be redrawn?
Ciao,
Paul
Paul
Re: Tooltip bug
You could try various times in the toolTipDelay
e.g.
in the card script
set the toolTipDelay of the target to 200
dictionary entry
http://2108.co.uk/LCDict/api.html?search=tooltipdelay
or
in each button
on mouseLeave
hide the tooltip of me
end mouseLeave
in the card script
on mouseLeave
hide the tooltip of the target
end mouseLeave
edit you may have to use
set the visible of the target to true / false instead of show / hide
e.g.
in the card script
set the toolTipDelay of the target to 200
dictionary entry
http://2108.co.uk/LCDict/api.html?search=tooltipdelay
or
in each button
on mouseLeave
hide the tooltip of me
end mouseLeave
in the card script
on mouseLeave
hide the tooltip of the target
end mouseLeave
edit you may have to use
set the visible of the target to true / false instead of show / hide
Andy Piddock
http://2108.co.uk/tinyide/ - Mini LC IDE alternative
http://2108.co.uk/script-editor-themer/ - Script Editor colour theming
http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources
http://2108.co.uk/tinyide/ - Mini LC IDE alternative
http://2108.co.uk/script-editor-themer/ - Script Editor colour theming
http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources
-
- VIP Livecode Opensource Backer
- Posts: 5792
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tooltip bug
I've done this in the past, see if it still works:
Code: Select all
on mouseEnter
set the tooltip of me to empty
set the tooltip of me to "whatever"
end mouseEnter
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Tooltip bug
Andy, hiding the target when the mouse exits isn't going to work. I don't want the control to disappear. The "toolTip" is just a text property, not an object in its own right. There presumably is a graphical object somewhere, but LC doesn't seem to give you explicit access to it.
Jacque, I would think your idea would work, but it doesn't. I copied the tooltip to a variable, set it to empty, then set it back to the variable. No joy.
Jacque, I would think your idea would work, but it doesn't. I copied the tooltip to a variable, set it to empty, then set it back to the variable. No joy.
Ciao,
Paul
Paul
Re: Tooltip bug
I think Andy wasn't trying to hide the target, but hide the tooltip, which (like my following code) he hadn't tested yet. Perhaps a combination?"of me" or the target depending on use of behavior or card script. (Sent on my phone)
Code: Select all
on mouseEnter
set the tooltip of me to "Now you see me"
end mouseEnter
on mouseLeave
set the tooltip of me to empty
end mouseLeave
Re: Tooltip bug
Yes, but as I said, "the toolTip of the target" isn't an object that can be hidden and shown, it's just a text string.SparkOut wrote: ↑Mon Sep 24, 2018 6:56 amI think Andy wasn't trying to hide the target, but hide the tooltip, which (like my following code) he hadn't tested yet. Perhaps a combination?"of me" or the target depending on use of behavior or card script. (Sent on my phone)Code: Select all
on mouseEnter set the tooltip of me to "Now you see me" end mouseEnter on mouseLeave set the tooltip of me to empty end mouseLeave
The reason I'm not setting the tooltip text on entry and then clearing it on exit is that the tooltip takes some computation to generate. The only way I could do that would be to store the tooltip text in another property, so that I wouldn't have to generate it every time the cursor flies by. Perhaps I'll give that a try, but it's getting a little ugly.
Ciao,
Paul
Paul
Re: Tooltip bug
Yes it's as noted, the way to hide the tooltip is to set the tooltip property to empty.
It's ugly but I don't see a way round (other than to separate the targets a little).
It's ugly but I don't see a way round (other than to separate the targets a little).
-
- VIP Livecode Opensource Backer
- Posts: 5792
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tooltip bug
That was going to be my next suggestion. Save the tooltip in a custom property of the control and then set the tooltip to empty on mouseLeave and reset it on mouseEnter.
If the user moves the mouse quickly you don't always get both messages, especially if the controls abut each other without space between. If that's happening you may need to do a loop through all the controls and set them all to empty before setting one of them again.
It isn't as messy as it sounds and is pretty fast.
If the user moves the mouse quickly you don't always get both messages, especially if the controls abut each other without space between. If that's happening you may need to do a loop through all the controls and set them all to empty before setting one of them again.
It isn't as messy as it sounds and is pretty fast.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com