I was adding tooltips to the application I was writing and had problems with the color of the tooltip text.
The application has several buttons that change the background color and text depending on the status of the button. The text is white or black.
The color of the tooltip text always seems to match the color of the button text. When the text on the button is white, then everything is fine, but if the text on the button is black, then the tooltip is black text on a black background. What I want to have is a hint to always be white text on black, regardless of the color of the button.
To do this, I installed my hint using:
self.setToolTip(toolTip)
Now I have found a potential solution to this, but it had its problems:
self.setToolTip("<font color=white>%s</font>" % toolTip.replace("\n", "<br/>"))
However, when I do this, the lines in my tooltip start to wrap, rather than saving the full length of the line in one line, which I want to do.
Any suggestions on how to change the color of the tooltip without using HTML, or how to make the HTML-based tooltip not pack?
thanks
source share