From: Neal Norwitz <nnorwitz@gmail.com> Date: Tue, 23 Jul 2002 02:52:58 +0000 (+0000) Subject: SF patch #581396, Canvas "select_item" always returns None X-Git-Tag: v2.3c1~4892 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58b63bf4e3e8ef082126c3687edd2cf75226303d;p=python SF patch #581396, Canvas "select_item" always returns None Return the selected item, if there is any. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index c5bf136f80..573d71da2e 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -2103,7 +2103,7 @@ class Canvas(Widget): self.tk.call(self._w, 'select', 'from', tagOrId, index) def select_item(self): """Return the item which has the selection.""" - self.tk.call(self._w, 'select', 'item') + return self.tk.call(self._w, 'select', 'item') or None def select_to(self, tagOrId, index): """Set the variable end of a selection in item TAGORID to INDEX.""" self.tk.call(self._w, 'select', 'to', tagOrId, index)