# SettableTooltipClient

**URL:** <https://forum.juce.com/t/settabletooltipclient/32299>\
**Category:** General JUCE discussion\
**Created:** [March 15, 2019, 5:44pm UTC](https://forum.juce.com/t/settabletooltipclient/32299 "2019-03-15T17:44:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [March 15, 2019, 5:44pm UTC](https://forum.juce.com/t/settabletooltipclient/32299/1 "2019-03-15T17:44:42Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 15, 2019, 6:37pm UTC](https://forum.juce.com/t/settabletooltipclient/32299/2 "2019-03-15T18:37:56Z")

</div>

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 ()`:

> <https://github.com/WeAreROLI/JUCE/blob/develop/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp#L48>

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…

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [March 25, 2019, 7:44pm UTC](https://forum.juce.com/t/settabletooltipclient/32299/3 "2019-03-25T19:44:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [August 4, 2019, 10:29am UTC](https://forum.juce.com/t/settabletooltipclient/32299/4 "2019-08-04T10:29:11Z")

</div>

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 -

> [@Why setTooltip doesn't work?](https://forum.juce.com/t/why-settooltip-doesnt-work/8974):
>
> In extra/example projects, I just write one line code in MainComponent contructor: quitButton-\>setTooltip(L"this is a quti button"); But when the mouse on the quit button,the tool tip doeesn’t work. I also read extra/JuceDemo souce code,setTooltip work in JuceDemo, I don’t know why,what’s the difference between the two projects. Thanks.
