From: Neal Norwitz Date: Tue, 23 Jul 2002 02:55:14 +0000 (+0000) Subject: SF patch #581396, Canvas "select_item" always returns None X-Git-Tag: v2.2.2b1~260 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a687414508a9829049cee5499730a9f5467e57fe;p=thirdparty%2FPython%2Fcpython.git 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 65d81874a371..9b400aa857d9 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -2095,7 +2095,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)