Commit 2849e0df authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of

integers instead of a string.  Based on patch by Guilherme Polo.
parent 0bdcdecc
...@@ -3511,7 +3511,7 @@ class Spinbox(Widget, XView): ...@@ -3511,7 +3511,7 @@ class Spinbox(Widget, XView):
bounding box may refer to a region outside the bounding box may refer to a region outside the
visible area of the window. visible area of the window.
""" """
return self.tk.call(self._w, 'bbox', index) return self._getints(self.tk.call(self._w, 'bbox', index)) or None
def delete(self, first, last=None): def delete(self, first, last=None):
"""Delete one or more elements of the spinbox. """Delete one or more elements of the spinbox.
......
...@@ -457,6 +457,18 @@ class SpinboxTest(EntryTest, unittest.TestCase): ...@@ -457,6 +457,18 @@ class SpinboxTest(EntryTest, unittest.TestCase):
widget = self.create() widget = self.create()
self.checkBooleanParam(widget, 'wrap') self.checkBooleanParam(widget, 'wrap')
def test_bbox(self):
widget = self.create()
bbox = widget.bbox(0)
self.assertEqual(len(bbox), 4)
for item in bbox:
self.assertIsInstance(item, int)
self.assertRaises(tkinter.TclError, widget.bbox, 'noindex')
self.assertRaises(tkinter.TclError, widget.bbox, None)
self.assertRaises(TypeError, widget.bbox)
self.assertRaises(TypeError, widget.bbox, 0, 1)
@add_standard_options(StandardOptionsTests) @add_standard_options(StandardOptionsTests)
class TextTest(AbstractWidgetTest, unittest.TestCase): class TextTest(AbstractWidgetTest, unittest.TestCase):
......
...@@ -13,6 +13,9 @@ Core and Builtins ...@@ -13,6 +13,9 @@ Core and Builtins
Library Library
------- -------
- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of
integers instead of a string. Based on patch by Guilherme Polo.
- Issue #19286: Directories in ``package_data`` are no longer added to - Issue #19286: Directories in ``package_data`` are no longer added to
the filelist, preventing failure outlined in the ticket. the filelist, preventing failure outlined in the ticket.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment