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:

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…

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

another tip for folks getting to this discussion looking for an answer is the SettableTooltipClient should be public / accessible.

Also of course you must have the TooltipWindow -

1 Like