SettableTooltipClient

#1

I’m trying to give my custom components a tooltip, but can’t work it out. (The standard JUCE components work fine.)

Here’s what im doing:
Inherit from settableTooltipClient
call setTooltip("foo"); somewhere.

what am I missing?

I will award you bonus points for telling me how to change the font size in the tooltip without rewriting the entire draw() callback :wink:

0 Likes

#2

I went in your trap. The TextLayout layoutTooltipText() is a static method, so I see no way changing that without rewriting the polymorphic getTooltipBounds() and drawTooltip ():

About the not showing up, any chance, you disabled the setInterceptMouseClicks() on your component or one of it’s parents? It blocks hitTest and therefore mouseEnter and mouseExit as well…
Just a shot in the dark…

0 Likes

#3

Ok I got it. The problem was that my custom components had child components themselves, which were screen filling. And the tooltip only shows for the uppermost component.

(Kinda obvious in hindsight ^^)

0 Likes