malouba
malouba

Reputation: 11

using combobox value

Thanks S. Lott for your prompt reply.

My question was about this link in my first post:

Python GTK adding signal to a combo box

I want to reuse the changed value of the combo in the main window GUI

Is it possible this way, and how ?

Thanks for some explanations

Best regards

Upvotes: 1

Views: 5136

Answers (1)

saeedgnu
saeedgnu

Reputation: 4366

If you are using a ComboBox with your own custom model, you can always get data for selected item:

index = combo.get_active()
model = combo.get_model()
item = model[index]
print item[0] ## , item[1], ...

But if you are using a text combobox (created with gtk.combo_box_new_text()), that's easier to use:

item_text = combo.get_active_text()
print item_text

Upvotes: 1

Related Questions