Fading textbox


So I’ve occasionally taken a quick hour to try and make all my Slider textboxs fade in/out with mouse hover events.

Every time I think it should be simple, but then end up coming up short.

First, tried setting the textBoxColour when the mouse hovers, but this doesn’t have an effect (Since the colour is a label colour set with lookAndFeel). Even getting the look and feel and then changing it doesn’t do it, though it seems like it should.

So, I tossed the slider textboxes, made my own custom labels, and got them fading … however, this requires me to use attachToComponent (which for some reason has orientations for left and above, but not below … where I want the labels). If I don’t use attachToComponent, I can try to set the position myself, but this turns out to be pretty difficult using getScreenX, etc.

So … these both seem like reasonable approaches, but I can’t help thinking I am missing some easier way.

Would it be reasonable to request a getLabel() method on the sliders to help access the label?

Or how about an attachToComponent() method that uses the TextEntryBoxPosition struct somehow?


I’ve been meaning to add an alpha setting to components, so you can fade them in and out… Just haven’t quite gotten around to it yet.


Well, that would get me half way there … but I still wouldn’t be able to access the textBox itself.

How about a Slider::getLabel() method to return a pointer to the textBox ?


Ah, I see what you mean now. Can’t you just use LookAndFeel::createSliderTextBox to create a custom textbox that does the fading?


Quite right, that didi it. Had already tried this method, but not realized that my LookAndFeel was not propagating to child components withing tabbed components, and things like that.

Now I have nice textboxes that fade in/out with the mouse hovering … sweeeet!!

Thanks -


I see you’ve removed the fadeOutComponent() method as well … gearing up to add alpha to components ?


No… I already added it!


oh damn … you’re on fire! Thanks for it!