On Mon, 2008-09-22 at 02:53 +1000, Neil Dugan wrote:
> 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().
> 

That did solve my problem! I was trying combobox.clear()! Thank you!

When I'm at it, is ComboBoxEntry a better choice than ComboBox (both are
in Glade)? It looks like the former has more options.

> Regards Neil.
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to