Re: Reading row from a ComboBox
- From: Damien Caliste <damien caliste cea fr>
- To: gtk-app-devel-list gnome org
- Subject: Re: Reading row from a ComboBox
- Date: Fri, 28 Sep 2007 16:27:50 +0200
Hello,
Le 28/09/2007, omar crea jusan it a Ãcrit :
1) how can I get a valid iter from the tree model?
In your application, in the callback of the "find" button, use
gtk_combo_box_get_active_iter() to get the iter from the selected entry
in your combobox.
2) when I obtain the current iter, how can I get the selected entry
of the combobox? I need to save it to a string for subsequent
processing.
Then, ask the associated model to get the stored string
gtk_tree_model_get() with the iter you previously get.
In the example you give, if I understand well, you try to select
initially the iter 9 in your combobox? Then, to do it, simply call
gtk_combo_box_set_active(combo, 8) (take care that first is numbered
0). The problem with the tree_path in your example may come from the
fact that you try to reach 9th child (#8) of first child (#0) of your
model (you give to indices to gtk_tree_path_new_from_indices()),
whereas your model has only one level.
Hope it helps,
Damien.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]