Issue #26386: Fixed ttk.TreeView selection operations with item id's

containing spaces.
This commit is contained in:
Serhiy Storchaka 2016-06-14 12:33:31 +03:00
parent 6afbc653a7
commit 8e6d09c1cc
3 changed files with 57 additions and 1 deletions

View file

@ -1392,7 +1392,9 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
def selection(self, selop=None, items=None):
"""If selop is not specified, returns selected items."""
return self.tk.call(self._w, "selection", selop, items)
if isinstance(items, (str, bytes)):
items = (items,)
return self.tk.splitlist(self.tk.call(self._w, "selection", selop, items))
def selection_set(self, items):