diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-02 18:32:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-02 18:32:49 (GMT) |
commit | 07bcf14b602863c3955e66a7874e750dd67a91df (patch) | |
tree | bc9a6d60d42bb629209bc9f1d87511fa21dba4d7 /Lib/tkinter/__init__.py | |
parent | 5631e1f38ddb18adbbc7a4fecc99e7343573eafb (diff) | |
parent | fc14ad996237839e601d08ac05bd6fe7838a8502 (diff) | |
download | cpython-07bcf14b602863c3955e66a7874e750dd67a91df.zip cpython-07bcf14b602863c3955e66a7874e750dd67a91df.tar.gz cpython-07bcf14b602863c3955e66a7874e750dd67a91df.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__.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index a9c8ce0..d37c39f 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2591,22 +2591,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: |