]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF patch #581396, Canvas "select_item" always returns None
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 23 Jul 2002 02:55:14 +0000 (02:55 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 23 Jul 2002 02:55:14 +0000 (02:55 +0000)
Return the selected item, if there is any.

Lib/lib-tk/Tkinter.py

index 65d81874a371d9edeb511c1aaa803cfeb58b6064..9b400aa857d9c75e32a316aee36ab7cada356633 100644 (file)
@@ -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)