From: Guido van Rossum Date: Mon, 11 Jul 1994 15:21:31 +0000 (+0000) Subject: Make Pack.newinfo() return a dict X-Git-Tag: v1.1~257 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69170c5d797404d440d61a89230f8f57fa9353b8;p=thirdparty%2FPython%2Fcpython.git Make Pack.newinfo() return a dict --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index c05704ec2c10..d0d93ed45948 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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: diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index c05704ec2c10..d0d93ed45948 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -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: