[pygtk] Two models: can I have only one?

John Finlay finlay at moeraki.com
Thu Oct 30 04:10:36 WST 2008


José Luis wrote:
> Hello to all!
>
> First, I explain my situation:
>
> I have one treeview and one combobox on my GUI. The treeview model 
> contains objects (it is a ListStore(object)). The ComboBox model has 
> only strings (ListStore(str)).
>
> My problem is that the information represented by the second model is 
> a subset of the informationon the treeview model.
>
> Is one method that I need to implement on my treeview model objects to 
> make it representable by the combobox?
>
You could use a TreeModelFilter to get what you wan. Seet:

http://pygtk.org/pygtk2tutorial/sec-TreeModelSortAndTreeModelFilter.html#sec-TreeModelFilter

http://pygtk.org/docs/pygtk/class-gtktreemodelfilter.html

John


More information about the pygtk mailing list