Tooltipping ComboBoxes


#1

I’m upgrading Juce to version 1.38 from 1.27. I have my own class of ComboBox that inherits from TooltipClient. When I try to compile with the new Juce, I get the message that ComboBoxInstance->setTooltip(…) is ambiguous. Sure enough, the ComboBox of version 1.38 implements SettableTooltipClient, which makes my inheritance from TooltipClient redundant. Cool - it’s gone. But now my tooltips acts all funny (in the non-funny way): Tooltips only appear when the mouse curser is at the frame of ComboBoxes… Only the pixels at the very periphery of the components show tooltips.

Anyone had similar problems? Any workarounds?

Thanks!

-A


#2

Okay, some more info on the case:

It turnes out, that when the tooltip is empty (not on the frame of the ComboBox, but “inside” the component), the adress of the object is different from when on the frame (when the right tooltip is there).

When the adress points to the “non-frame” object, the tooltip is indeed an empty string. Now, the trouble is: why are the adresses different? There are several ComboBoxes here and there in my program, they all behave like this (though they were fine with old juce), and they are created and added just like all my other components, that work fine.

EDIT: Oh, okay… When the mouse is over the “pulldown-arrow” the tooltip is fine too. That probably means, that the label in the ComboBox acts as it’s own component on top of the ComboBox. That explains the different adress and missing tooltip. Naughty-naughty. Now I just have to figure out how to make the MouseOver-ness pass through the label…?


#3

Ah yes… that’ll be because it contains a Label, and the Label has its own tooltip.

A neat fix for this would be to make the ComboBox a TooltipClient instead of a SettableTooltipClient, then add a couple of functions:

[code] void setTooltip (const String& newTooltip) { label->setTooltip (newTooltip); }

const String getTooltip()                                       { return label->getTooltip(); }

[/code]


#4

YES - I just figured that out too :slight_smile:

  • thanks for your reply… It’s funny how i dialogue with myself helps to solve issues.

EDIT: Btw, I did another fix. I made the label in the ComboBox public (ugly), and then wrote another setTooltip function in my ComboBox class that sets the label’s tooltip too.


#5

[quote=“amygdala”]YES - I just figured that out too :slight_smile:

  • thanks for your reply… It’s funny how i dialogue with myself helps to solve issues.
    [/quote]

too right. i hold the firm belief that the ‘submit’ button is actually programmed to put the answer straight into your brain.


#6

[quote=“haydxn”]
too right. i hold the firm belief that the ‘submit’ button is actually programmed to put the answer straight into your brain.[/quote]

Sweet… I should post more often :slight_smile: - I heard a story about some famous computer scientist, who had long complicated dialogous (!) with his lamp. Appearently it was very helpful… “It” referring to either the dialogue or lamp, I don’t know which :slight_smile:

-A


#7