Skip to content

Commit db87816

Browse files
committed
Fixed Slider.update so that the range is applied first
1 parent 209e2d2 commit db87816

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PySimpleGUI.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/python3
2-
version = __version__ = "4.56.0.2 Uneleased"
2+
version = __version__ = "4.56.0.3 Uneleased"
33

44
_change_log = """
55
Changelog since 4.56.0 released to PyPI on 5-Jan-2022
@@ -8,6 +8,8 @@
88
set_options - added disable_modal_windows option to provide a single call to disable the modal feature globally (including popups)
99
4.56.0.2
1010
Added OptionMenu to the list of tkinter widgets that are ignored when the grab anywhere feature is used
11+
4.56.0.3
12+
Slider - update the range FIRST and then the value in the update method (thank you Jason for the fix)
1113
"""
1214

1315
__version__ = version.split()[0] # For PEP 396 and PEP 345
@@ -7010,6 +7012,8 @@ def update(self, value=None, range=(None, None), disabled=None, visible=None):
70107012
if not self._widget_was_created(): # if widget hasn't been created yet, then don't allow
70117013
return
70127014

7015+
if range != (None, None):
7016+
self.TKScale.config(from_=range[0], to_=range[1])
70137017
if value is not None:
70147018
try:
70157019
self.TKIntVar.set(value)
@@ -7029,6 +7033,7 @@ def update(self, value=None, range=(None, None), disabled=None, visible=None):
70297033
if visible is not None:
70307034
self._visible = visible
70317035

7036+
70327037
def _SliderChangedHandler(self, event):
70337038
"""
70347039
Not user callable. Callback function for when slider is moved.

0 commit comments

Comments
 (0)