]> granicus.if.org Git - python/commitdiff
Use self.__class__ to instantiate a TreeNode item recursively, to
authorGuido van Rossum <guido@python.org>
Mon, 27 May 2002 13:35:05 +0000 (13:35 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 May 2002 13:35:05 +0000 (13:35 +0000)
allow subclassing.

Tools/idle/TreeWidget.py

index be80a635e58e688593dd7ab330ff0ea0cd7d1897..37bc58f2ead6b47106b351424454c89ac7e82bc4 100644 (file)
@@ -187,7 +187,7 @@ class TreeNode:
                 # _IsExpandable() was mistaken; that's allowed
                 return y+17
             for item in sublist:
-                child = TreeNode(self.canvas, self, item)
+                child = self.__class__(self.canvas, self, item)
                 self.children.append(child)
         cx = x+20
         cy = y+17