For PySimpleGUI, instead of window.read
, call sg.read_all_windows
in event loop for multi-windows.
window, event, values = read_all_windows(timeout=None, timeout_key=TIMEOUT_KEY)
Reads all windows that are "active" when the call is made. "Active" means that it's been finalized or read.
If a window has not been finalized then it will not be considered an "active window"
If any of the active windows returns a value then the window and its event and values are returned.
If no windows are open, then the value (None, WIN_CLOSED, None) will be returned
Since WIN_CLOSED is None, it means (None, None, None) is what's returned when no windows remain opened