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 Nov 01, 2014 6:17 am

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 
Offline

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.

thanks


Tim


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 22, 2007 4:07 pm 
Offline
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: http://scentric.net/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!


Top
 Profile  
 
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 1 guest


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