How to delete PyGTK ComboBox entries?

Maël Benjamin Mettler mbm at mediamonger.ch
Mon Feb 26 11:44:05 EST 2007


Hej!
> >
> > model = combo_box.get_model()
> > combo_box.set_model(None)
> > model.clear()
> > for entry in desired_entries:
> >     model.append([entry])
> > combo_box.set_model(model)
> >
> > model.append is essentially the same as combo_box.append_text. Setting
> > the model to None before making changes to it speeds things at least in
> > the case of tree views. I'm not sure if it does much with combo boxes.
> > If you experince speed issues with combo boxes you're either doing
> > something very wrong or you have so many entries that you ought to be
> > using a tree view instead.
> >

Works like a charm. Thanks a lot!




More information about the Python-list mailing list