-1

So basically i am using SimpleGUI and am able to create multiple windows, even with same content without errors. Now i just cannot get the events happening in the other windows that were created.

Is there any solution to create multiple windows and catch their events?

BigAgg
  • 31
  • 4
  • https://pysimplegui.readthedocs.io/en/latest/cookbook/#recipe-multiple-windows-read_all_windows – Robᵩ Apr 06 '22 at 17:16

2 Answers2

1

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

Jason Yang
  • 11,284
  • 2
  • 9
  • 23
0

You can use event viewer to navigate through:

  • Open Event Viewer by clicking the Start button
  • Click Control Panel
  • Click System and Security
  • Click Administrative Tools
  • Click Event Viewer
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Mark Kenn
  • 1
  • 1
  • This is a coding question about PySimpleGUI, so it should be about PySimpleGUI code. If your method works, you will still have to do on other Windows (which is bad idea) + he/she may not use Windows. – BrainFl Apr 07 '22 at 11:23