Tooltip bug

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Tooltip bug

Post by pderocco » Sun Sep 23, 2018 12:33 am

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?
Ciao,
Paul

AndyP
Posts: 381
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Tooltip bug

Post by AndyP » Sun Sep 23, 2018 8:56 am

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
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4696
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Tooltip bug

Post by jacque » Sun Sep 23, 2018 5:01 pm

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

pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Re: Tooltip bug

Post by pderocco » Mon Sep 24, 2018 12:55 am

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.
Ciao,
Paul

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Tooltip bug

Post by SparkOut » Mon Sep 24, 2018 6:56 am

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?

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
"of me" or the target depending on use of behavior or card script. (Sent on my phone)

pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Re: Tooltip bug

Post by pderocco » Mon Sep 24, 2018 7:24 am

SparkOut wrote:
Mon Sep 24, 2018 6:56 am
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?

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
"of me" or the target depending on use of behavior or card script. (Sent on my phone)
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.

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

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Tooltip bug

Post by SparkOut » Mon Sep 24, 2018 5:00 pm

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).

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4696
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Tooltip bug

Post by jacque » Mon Sep 24, 2018 6:01 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Bug Triage”