 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
spippo
Joined: 22 Feb 2007 Posts: 1
|
Posted: Thu Feb 22, 2007 3:55 pm Post subject: Bold or colored text in a ComboBox??? |
|
|
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: 387 Location: Fairfax, Virginia
|
Posted: Thu Feb 22, 2007 4:07 pm Post subject: |
|
|
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 |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|