GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bold or colored text in a ComboBox???

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
spippo



Joined: 22 Feb 2007
Posts: 1

PostPosted: Thu Feb 22, 2007 3:55 pm    Post subject: Bold or colored text in a ComboBox??? Reply with quote

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
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Thu Feb 22, 2007 4:07 pm    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP