summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-07 17:30:36 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-07 17:30:36 (GMT)
commit985b8dbe115f85ad10567a70645db6eeb9c2a33a (patch)
tree8f86b9323ec5966520b4c34829ed595cb1fe3126 /Lib/tkinter/__init__.py
parent9ca21b3e1d0cd350fd73b2fa661a666631dd4efc (diff)
parenta21acb5d95841e7d2c8491f40189a853cb7b5df4 (diff)
downloadcpython-985b8dbe115f85ad10567a70645db6eeb9c2a33a.zip
cpython-985b8dbe115f85ad10567a70645db6eeb9c2a33a.tar.gz
cpython-985b8dbe115f85ad10567a70645db6eeb9c2a33a.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__.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 73fca8f..7aa37da 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
@@ -3433,8 +3437,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):
@@ -3803,7 +3810,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: