diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-07 17:27:42 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-07 17:27:42 (GMT) |
commit | a21acb5d95841e7d2c8491f40189a853cb7b5df4 (patch) | |
tree | 10b5b71cb87b5edb5eefc48b08b3abc912b6a5ed /Lib/tkinter/__init__.py | |
parent | 0455c3fd28256940ad02ac39335816c1bdab0af9 (diff) | |
download | cpython-a21acb5d95841e7d2c8491f40189a853cb7b5df4.zip cpython-a21acb5d95841e7d2c8491f40189a853cb7b5df4.tar.gz cpython-a21acb5d95841e7d2c8491f40189a853cb7b5df4.tar.bz2 |
Issue #20072: Fixed multiple errors in tkinter with wantobjects is False.
* Misc.image_names(), Misc.image_types(), Wm.wm_colormapwindows(), and
LabelFrame.panes() now always return a tuple.
* Fixed error of comparing str and int in tt.LabeledScale._adjust().
* ttk.Notebook.index() now always returns int.
* ttk.Notebook.tabs() now always returns a tuple.
* ttk.Entry.bbox() now always returns a tuple of ints.
* ttk.Entry.validate() now always correctly works.
* ttk.Combobox.current() now always returns int.
* ttk.Panedwindow.sashpos() now always returns int.
* ttk.Treeview.bbox() now always returns a tuple of ints.
* ttk.Treeview.get_children() now always returns a tuple.
* ttk.Treeview.exists() now always correctly works.
* ttk.Treeview.index() now always returns int.
* ttk.Treeview.tag_has() now always returns 0 or 1.
* And numerous other errors in methods which returns a tuple, list or dict.
* Fixed ttk tests for wantobjects is False.
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r-- | Lib/tkinter/__init__.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 95b2581..2fdabde 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -1459,11 +1459,11 @@ class Misc: def image_names(self): """Return a list of all existing image names.""" - return self.tk.call('image', 'names') + return self.tk.splitlist(self.tk.call('image', 'names')) def image_types(self): """Return a list of all available image types (e.g. phote bitmap).""" - return self.tk.call('image', 'types') + return self.tk.splitlist(self.tk.call('image', 'types')) class CallWrapper: @@ -1577,7 +1577,11 @@ class Wm: if len(wlist) > 1: wlist = (wlist,) # Tk needs a list of windows here args = ('wm', 'colormapwindows', self._w) + wlist - return [self._nametowidget(x) for x in self.tk.call(args)] + if wlist: + self.tk.call(args) + else: + return [self._nametowidget(x) + for x in self.tk.splitlist(self.tk.call(args))] colormapwindows = wm_colormapwindows def wm_command(self, value=None): """Store VALUE in WM_COMMAND property. It is the command @@ -3472,8 +3476,11 @@ class BitmapImage(Image): Valid resource names: background, data, file, foreground, maskdata, maskfile.""" Image.__init__(self, 'bitmap', name, cnf, master, **kw) -def image_names(): return _default_root.tk.call('image', 'names') -def image_types(): return _default_root.tk.call('image', 'types') +def image_names(): + return _default_root.tk.splitlist(_default_root.tk.call('image', 'names')) + +def image_types(): + return _default_root.tk.splitlist(_default_root.tk.call('image', 'types')) class Spinbox(Widget, XView): @@ -3842,7 +3849,7 @@ class PanedWindow(Widget): def panes(self): """Returns an ordered list of the child panes.""" - return self.tk.call(self._w, 'panes') + return self.tk.splitlist(self.tk.call(self._w, 'panes')) ###################################################################### # Extensions: |