Page 1 of 1
tooltip font [SOLVED]
Posted: Mon Sep 22, 2008 17:45
by fezztah
I'd like to set the tool tip font, but I can't see how that would be done. The problem is some of the tool tips are quite long - a good sentence or so and the font they are using is too big.
You can set the main font of buttons, etc as a widget property in the layout, but I don't think there is a property for tooltip font?
Perhaps there is a way to specify a default value in the looknfeel for the TaharezLook/Tooltip ?
Posted: Mon Sep 22, 2008 20:52
by Kevin
Hello,
It seems that Tooltip inherits from Window, and as such, it has all the same Font functionality as all other windows. Specifically, it has both setFont(Font* font) and setFont(const String& name) functions.
You will also notice (on
this page) that there is a Font property for Tooltips (in both WindowsLook and TaharezLook).
Hope that helps.
Kevin
Posted: Tue Sep 23, 2008 09:11
by fezztah
But that would require you to access it at run time and the tooltips are only created "as needed" by the system so how would you do that? Normally to set a font you go:
getWindow("my win name")->setFont("blah")
but you can't do that with a tooltip can you? It doesn't have a name?
The tooltip is only mentioned in the looknfeel file, I don't think you can set a font in that can you? Normally fonts are set in the layout, but tooltips never appear in a layout file.
I suppose I could create a completely new tooltip class that I use instead of the default one that just sets the font to be something else?
Posted: Tue Sep 23, 2008 09:56
by scriptkid
A window always has a default tooltip object at least. However it just isn't always visible.
So you can do this:
Code: Select all
getWindow("my win name")->getTooltip()->setFont("blah")
You might add some Null checks just to be sure...
HTH.
Posted: Tue Sep 23, 2008 10:01
by fezztah
Ah, of course. Unless you use custom tooltips then every widget is using the same default tooltip object. So if I grab the first button I see as the app starts and set the font there then it's changed on every menu screen in the entire app.
thanks...
Posted: Wed Sep 24, 2008 19:17
by Jamarr
fezztah wrote:Ah, of course. Unless you use custom tooltips then every widget is using the same default tooltip object. So if I grab the first button I see as the app starts and set the font there then it's changed on every menu screen in the entire app.
thanks...
Wouldn't it just be easier to do this during initialization:
Code: Select all
CEGUI::System::getSingleton().getDefaultTooltip()->setFont(...);
Posted: Wed Sep 24, 2008 19:43
by scriptkid
Jamarr wrote:Wouldn't it just be easier to do this during initialization:
Code: Select all
CEGUI::System::getSingleton().getDefaultTooltip()->setFont(...);
<bows>