[pygtk] How to add items to an empty ComboBox / ComboBoxEntry (created with glade) ?
Neil Dugan
pygtk at butterflystitches.com.au
Mon Sep 22 00:53:12 WST 2008
Mats Taraldsvik wrote:
> Dear list,
>
> I'm creating an application with pyGTK and Glade. In this I want to
> populate a combobox(2) depending on the selected item in another
> combobox(1).
>
> Usually, I add None as an item of the comboboxes in glade, because
> nothing happens when I try to add items to an empty combobox. However,
> since I have to repopulate a combobox(2), I need the proper solution,
> since I have to empty it depending on combobox(1).
>
> Regards,
> Mats Taraldsvik
>
Hi,
This is untested!
A 'combobox.get_model().clear()' should clear what is all ready in the
combobox, then a 'combobox.append_text()' should add new entries to
the combobox.
note: this will most likely only work with a combobox created by
gtk.combo_box_new_text().
Regards Neil.
More information about the pygtk
mailing list