[Python-checkins] r64902 - in sandbox/trunk/ttk-gsoc: Doc/library/ttk.rst src/2.x/ttk.py src/3.x/ttk.py

guilherme.polo python-checkins at python.org
Sun Jul 13 02:23:34 CEST 2008


Author: guilherme.polo
Date: Sun Jul 13 02:23:26 2008
New Revision: 64902

Log:
Changed Treeview's get_children method, if nothing is passed to it, it returns
all root children;


Modified:
   sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst
   sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
   sandbox/trunk/ttk-gsoc/src/3.x/ttk.py

Modified: sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst
==============================================================================
--- sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst	(original)
+++ sandbox/trunk/ttk-gsoc/Doc/library/ttk.rst	Sun Jul 13 02:23:26 2008
@@ -846,10 +846,12 @@
       scrolled offscreen), returns an empty string.
 
 
-   .. method:: get_children(item)
+   .. method:: get_children([item])
 
       Returns the list of children belonging to *item*.
 
+      If *item* is not specified, returns all root children.
+
 
    .. method:: set_children(item, newchildren)
 

Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	Sun Jul 13 02:23:26 2008
@@ -1134,9 +1134,11 @@
         return self.tk.call(self._w, "bbox", item, column)
 
 
-    def get_children(self, item):
-        """Returns a tuple of children belonging to item."""
-        return self.tk.call(self._w, "children", item)
+    def get_children(self, item=None):
+        """Returns a tuple of children belonging to item.
+        
+        If item is not specified, returns all root children."""
+        return self.tk.call(self._w, "children", item or '')
 
 
     def set_children(self, item, newchildren):

Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	Sun Jul 13 02:23:26 2008
@@ -1134,9 +1134,11 @@
         return self.tk.call(self._w, "bbox", item, column)
 
 
-    def get_children(self, item):
-        """Returns a tuple of children belonging to item."""
-        return self.tk.call(self._w, "children", item)
+    def get_children(self, item=None):
+        """Returns a tuple of children belonging to item.
+        
+        If item is not specified, returns all root children."""
+        return self.tk.call(self._w, "children", item or '')
 
 
     def set_children(self, item, newchildren):


More information about the Python-checkins mailing list