GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 25, 2014 5:36 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Cairo, GTK default font and widget state
PostPosted: Tue Jun 05, 2007 12:45 pm 
Offline

Joined: Tue Jun 05, 2007 7:54 am
Posts: 4
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 6:59 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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/ ... Fonts.html

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 1:18 pm 
Offline

Joined: Tue Jun 05, 2007 7:54 am
Posts: 4
thank you, i will try this now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group