[pygtk] initialize a combo list

Thomas Mills Hinkle Thomas_Hinkle at alumni.brown.edu
Mon Oct 4 18:22:30 WST 2004

On Mon, 4 Oct 2004 03:03:58 -0700 "David M. Cook" <dave at davidcook.org>
> I would suggest using a TreeModelFilter with a custom visible func,
> e.g.
> entries = [refs to your entries here]
> filter = mymodel.filter_new()
> filter.set_visible_func(visible_func, entries)
> cbentry.set_model(filter)
> ...
> def visible_func(model, iter, entries):
>     # test model values against entry values

Thanks -- this is similar to what I've been doing, but I've been setting
the visible_func to look at a variable and then manually calling

Will the refiltering really happen automatically if I just make the
function call Entry.get_text() directly? (if so, when does this happen?
If not, I still need to connect the refilter() call to some event)

(Sorry to fire back a question so fast -- I'm curious about how this
works. Needless to say, I'll try implementing your suggestion shortly
and then see for myself if it works).


More information about the pygtk mailing list