It is not possible to instantiate a TreePath empty
Submitted by Cédric Krier
Link to original bug (#770665)
Description
Created attachment 334547 patch
The __new__
method of TreePath has zero as default value for path. So this makes it point to the first row. But indeed it could be needed to instantiate a TreePath empty. For example, it is needed to call rows_reordered which must reorder the all tree.
Here is a patch that allow to use None, () and '' as path.
Also I put None as default value for path because it seems more logical but if it is needed for backward compatibility, we can keep 0 as default value.
FYI, it is possible to get a empty TreePath with this code:
path = Gtk.TreePath() path.up()
Patch 334547, "patch":
TreePath.patch