bpo-39152: add missing ttk.Scale.configure return value (GH-17815)

tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name
or a list thereof for all options. Based on patch Giovanni Lombardo.
This commit is contained in:
Terry Jan Reedy 2020-01-05 11:23:58 -05:00 committed by GitHub
parent b19c0d77e6
commit 5ea7bb25e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View file

@ -1084,11 +1084,12 @@ class Scale(Widget, tkinter.Scale):
Setting a value for any of the "from", "from_" or "to" options
generates a <<RangeChanged>> event."""
if cnf:
retval = Widget.configure(self, cnf, **kw)
if not isinstance(cnf, (type(None), str)):
kw.update(cnf)
Widget.configure(self, **kw)
if any(['from' in kw, 'from_' in kw, 'to' in kw]):
self.event_generate('<<RangeChanged>>')
return retval
def get(self, x=None, y=None):