Set up combobox in treeview with options in colored background

Andre Colomb sent me a very interesting and useful sample code.

Quoted from his email:
“I’ve been trying to mess around with GtkCellRendererCombo some more. In my application, there are several combo boxes to select a value between 1 and 10. For the user to see which is good and which is bad, I set the background color for each cell in the combo box accordingly–which works perfectly. I added another column in the combo model holding the
color and change the background using a callback set with GtkCellLayout::set_cell_data_func().”

His sample code produces this:
0303.1.gif

Cool, isn’t it?

Here are the sample codes contributed by Andre Colomb:

How to set up combobox in treeview with colors - Part 1?

How to set up combobox in treeview with colors - Part 2?

/kksou

http://www.kksou.com/php-gtk2
The place for php-gtk2 sample codes

Leave a Reply