I've been experimenting with the TreeModelFilter class, and I've noticed
something really odd. Hopefully, its due to my misunderstanding of the
class.

When I modify a model to create a filtered model, I seem to lose the top
level nodes, and what appears as the top level nodes only have the
children of the first node.

I've seen this with my own models, and with the treemodel.py shipped
with pygtk as an example.

If I modify the treemodel.py file from:

  model = MyTreeModel()

to:

  model = MyTreeModel().filter_new(0)
  model.set_visible_column(1)

and modify on_get_value to return 1 for the second column, I encounter
the problem.

The original returns something like:

(0,)
  (0,0)
    (0,0,0)
    (0,0,1)
    (0,0,2)
  (0,1)
    (0,1,0)
    (0,1,1)
    (0,1,2)
  (0,2)
    (0,2,0)
    (0,2,1)
    (0,2,2)
 
etc.

The new one returns:

(0,0)
  (0,0,0)
  (0,0,1)
  (0,0,2)
(0,1)
  (0,1,0)
  (0,1,1)
  (0,1,2)

etc.

I've attached the test case.


Attachment: treemodel.py
Description: application/python

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

Reply via email to