From 40757180b5d0ac66d44958e4ab13329c7b03ea36 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 15 Jan 2022 08:56:08 -0500 Subject: [PATCH] Fix for enable_events for Spin element. Changed how the event is generated. Need to determine manual entry of value still --- PySimpleGUI.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index d3cb3526..0b70d0b6 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = __version__ = "4.56.0.5 Uneleased" +version = __version__ = "4.56.0.6 Unreleased" _change_log = """ Changelog since 4.56.0 released to PyPI on 5-Jan-2022 @@ -15,6 +15,8 @@ _change_log = """ in place if visibility changes 4.56.0.5 Replaced sponsor tab with a tab about the udemy course as well as the buy me a coffee link. + 4.56.0.6 + Fixed event generation for Spin element. Also changed to use the "command" parameter to get the event. NOTE - still need to handle manual entry """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -1184,6 +1186,14 @@ class Element(): """ self._generic_callback_handler('') + + def _SpinboxSelectHandler(self): + """ + Internal callback function for when an entry is selected in a Combobox. + + """ + self._generic_callback_handler('') + def _RadioHandler(self): """ Internal callback for when a radio button is selected and enable events was set for radio @@ -15005,9 +15015,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): if text_color is not None and text_color != COLOR_SYSTEM_DEFAULT: element.TKSpinBox.configure(fg=text_color) if element.ChangeSubmits: - element.TKSpinBox.bind('', element._SpinChangedHandler) - element.TKSpinBox.bind('', element._SpinChangedHandler) - element.TKSpinBox.bind('', element._SpinChangedHandler) + element.TKSpinBox.configure(command=element._SpinboxSelectHandler) + # element.TKSpinBox.bind('', element._SpinChangedHandler) + # element.TKSpinBox.bind('', element._SpinChangedHandler) + # element.TKSpinBox.bind('', element._SpinChangedHandler) if element.Readonly: element.TKSpinBox['state'] = 'readonly' if element.Disabled is True: # note overrides readonly if disabled