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

containing spaces.
This commit is contained in:
Serhiy Storchaka 2016-06-14 12:39:18 +03:00
commit 255bbf2d25
3 changed files with 57 additions and 1 deletions

View file

@ -1396,7 +1396,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):