Fixed Slider.update so that the range is applied first

This commit is contained in:
PySimpleGUI 2022-01-09 09:28:48 -05:00
parent 209e2d25d0
commit db87816370
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3
version = __version__ = "4.56.0.2 Uneleased"
version = __version__ = "4.56.0.3 Uneleased"
_change_log = """
Changelog since 4.56.0 released to PyPI on 5-Jan-2022
@ -8,6 +8,8 @@ _change_log = """
set_options - added disable_modal_windows option to provide a single call to disable the modal feature globally (including popups)
4.56.0.2
Added OptionMenu to the list of tkinter widgets that are ignored when the grab anywhere feature is used
4.56.0.3
Slider - update the range FIRST and then the value in the update method (thank you Jason for the fix)
"""
__version__ = version.split()[0] # For PEP 396 and PEP 345
@ -7010,6 +7012,8 @@ class Slider(Element):
if not self._widget_was_created(): # if widget hasn't been created yet, then don't allow
return
if range != (None, None):
self.TKScale.config(from_=range[0], to_=range[1])
if value is not None:
try:
self.TKIntVar.set(value)
@ -7029,6 +7033,7 @@ class Slider(Element):
if visible is not None:
self._visible = visible
def _SliderChangedHandler(self, event):
"""
Not user callable. Callback function for when slider is moved.