FreeSimpleGUI
FreeSimpleGUI copied to clipboard
SUPPRESS_RAISE_KEY_ERRORS isn't honored
As it says, setting the following still does show the FreeSimpleGUI error window, preventing handling KeyErrors from program.
sg.set_options(
suppress_raise_key_errors=True,
suppress_error_popups=True,
suppress_key_guessing=True,
)
Thanks for the report. Can you please provide a minimum reproducible example (so I can run it and reproduce) and/or if you have a full stacktrace, that would be helpful, too.
Sure:
import FreeSimpleGUI as sg
sg.set_options(suppress_error_popups=True, suppress_key_guessing=True, suppress_raise_key_errors=True)
layout = [
[sg.Text('Hello')],
[sg.Button("trigger update to non existing key", key="-KEY-")],
[sg.Button('OK')]
]
window = sg.Window('Test', layout)
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
if event == 'OK':
print('OK')
break
if event == "-KEY-":
window["nonexisting"].Update("This key does not exist")
window.close()
In the above example, I disabled all debugger options via set_options. In PySimpleGUI, this prevented the following window to show:
Regardless of how I configure those options, I don't get the same result as PySimpleGUI v4.