GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Aug 23, 2016 9:04 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Bold or colored text in a ComboBox???
PostPosted: Thu Feb 22, 2007 3:55 pm 

Joined: Thu Feb 22, 2007 3:51 pm
Posts: 1
Hi all,

In my program, i make several ComboBoxes in a window.
Now I want some of the lines (rows) in some ComboBoxes to be bold or in a color. Is this posible??? Can you also give an example, please.



 Post subject:
PostPosted: Thu Feb 22, 2007 4:07 pm 
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
There are two way of using a GtkComboBox widget. If you create it with gtk_combo_box_new_text(), it will hide the model from you, providing only strings. To customize this model, you can connect a cell data function to the model so that you can customize each cell before it is rendered.

The other way is to use gtk_combo_box_new(), in which you will have to provide your own GtkTreeModel, which is usually of the type GtkListStore. If you do this, you can just create it like any other tree model, using tree model columns to change the look of each row.

For more information about tree models and cell data functions, you should view this GtkTreeView tutorial: It doesn't directly relate to GtkComboBox, but can be used to figure out how to create tree models.

Andrew Krause

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

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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