 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
gdw
Joined: 05 Jun 2007 Posts: 4
|
Posted: Tue Jun 05, 2007 12:45 pm Post subject: Cairo, GTK default font and widget state |
|
|
Hello,
I have implemented a GtkTreeView with my custom cell rendered.
Now, I would like to render the treeview items taking into account:
- the current widget state (disabled, selected, etc)
- the default font for widgets.
The colors and the font may change when a new theme is applied, for exemple. How can I retreive these values?
Notice that I use Cairo to render the item text, so I need to have a Cairo description of the default font...
Thank you
Guilhem |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 386 Location: Fairfax, Virginia
|
Posted: Tue Jun 05, 2007 6:59 pm Post subject: |
|
|
You can get the current widget state with GtkStateType. You can retrieve information about the default colors of the text for the state from the GtkTreeView's style at GTK_WIDGET(treeview)->style. This is a GtkStyle object.
As for the font, the style structure includes a PangoFontDescription member called font_desc. You can get information about the font such as style, size, and family from the font description. From this information, you can set the Cairo font. Check out: http://developer.gnome.org/doc/API/2.0/pango/pango-Fonts.html |
|
| Back to top |
|
 |
gdw
Joined: 05 Jun 2007 Posts: 4
|
Posted: Thu Jun 07, 2007 1:18 pm Post subject: |
|
|
| thank you, i will try this now! |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|