summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-06-02 18:31:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-06-02 18:31:07 (GMT)
commitfc14ad996237839e601d08ac05bd6fe7838a8502 (patch)
tree3ce35e5c86e4929e9b73f1f100a778b8d374606c /Lib/tkinter/__init__.py
parent90441e857d2f0d0224899a328e89fd8d694e45ef (diff)
downloadcpython-fc14ad996237839e601d08ac05bd6fe7838a8502.zip
cpython-fc14ad996237839e601d08ac05bd6fe7838a8502.tar.gz
cpython-fc14ad996237839e601d08ac05bd6fe7838a8502.tar.bz2
Issue #6181: Fixed minor bugs in tkinter.Listbox methods:
bbox(), curselection() and get().
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index fea4bd9..10ac188 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -2586,22 +2586,19 @@ class Listbox(Widget, XView, YView):
def activate(self, index):
"""Activate item identified by INDEX."""
self.tk.call(self._w, 'activate', index)
- def bbox(self, *args):
+ def bbox(self, index):
"""Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
- which encloses the item identified by index in ARGS."""
- return self._getints(
- self.tk.call((self._w, 'bbox') + args)) or None
+ which encloses the item identified by the given index."""
+ return self._getints(self.tk.call(self._w, 'bbox', index)) or None
def curselection(self):
- """Return list of indices of currently selected item."""
- # XXX Ought to apply self._getints()...
- return self.tk.splitlist(self.tk.call(
- self._w, 'curselection'))
+ """Return the indices of currently selected item."""
+ return self._getints(self.tk.call(self._w, 'curselection')) or ()
def delete(self, first, last=None):
"""Delete items from FIRST to LAST (included)."""
self.tk.call(self._w, 'delete', first, last)
def get(self, first, last=None):
"""Get list of items from FIRST to LAST (included)."""
- if last:
+ if last is not None:
return self.tk.splitlist(self.tk.call(
self._w, 'get', first, last))
else: