tags:

views:

69

answers:

1

I want to set my GtkComboBox to have some default value/name, on it as follows:

+---------------+---+
| Image Options | X |
+---------------+---+
| Image Option 1    |         
+-------------------+
| Image Option 2    |         
+-------------------+
| Image Option 3    |         
+-------------------+

"Image Options" will be just a Title and it will disappear once user selects any option from list. when user click on the list and selects "Image Option 3" then it will display selected value insted of "Image Options". "Image Options" will not be a part of option list.

+1  A: 

I don't think you can. The GtkComboBox shows data from a model. You're asking it to show a piece of data that is not in the model.

If you want to change which row of data (in the model) is changed, you can use the gtk_combo_box_set_active() call. Note that it takes an integer index (model row number) though, not a string so you cannot use it to make the box show data that is not in the model.

Consider labelling the widget using a nearby GtkLabel instead, or perhaps using a pop-up tooltip.

unwind
Hi, Can we get label inside GtkComboBox and set text to it.and is there anyway of setting default selection to GtkComboBox?
PP