]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make Pack.newinfo() return a dict
authorGuido van Rossum <guido@python.org>
Mon, 11 Jul 1994 15:21:31 +0000 (15:21 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 11 Jul 1994 15:21:31 +0000 (15:21 +0000)
Lib/lib-tk/Tkinter.py
Lib/tkinter/Tkinter.py

index c05704ec2c1026feb0cdac298d647600aa05c981..d0d93ed45948f2d099e43524983d16c2019c9fea 100644 (file)
@@ -552,7 +552,16 @@ class Pack:
        def forget(self):
                self.tk.call('pack', 'forget', self._w)
        def newinfo(self):
-               return self.tk.call('pack', 'newinfo', self._w)
+               words = self.tk.splitlist(
+                       self.tk.call('pack', 'newinfo', self._w))
+               dict = {}
+               for i in range(0, len(words), 2):
+                       key = words[i][1:]
+                       value = words[i+1]
+                       if value[0] == '.':
+                               value = self._nametowidget(value)
+                       dict[key] = value
+               return dict
        info = newinfo
        def propagate(self, boolean=None):
                if boolean:
index c05704ec2c1026feb0cdac298d647600aa05c981..d0d93ed45948f2d099e43524983d16c2019c9fea 100755 (executable)
@@ -552,7 +552,16 @@ class Pack:
        def forget(self):
                self.tk.call('pack', 'forget', self._w)
        def newinfo(self):
-               return self.tk.call('pack', 'newinfo', self._w)
+               words = self.tk.splitlist(
+                       self.tk.call('pack', 'newinfo', self._w))
+               dict = {}
+               for i in range(0, len(words), 2):
+                       key = words[i][1:]
+                       value = words[i+1]
+                       if value[0] == '.':
+                               value = self._nametowidget(value)
+                       dict[key] = value
+               return dict
        info = newinfo
        def propagate(self, boolean=None):
                if boolean: