-1

This is my first try with PySimpleGUI.

I've written a simple window with three output fields:

  • Text
  • Output
  • Multiline

The window paints fine, and the default values display. But I can't get any of the fields to update.

Am I doing something stupid (almost certainly!)?

Here is the code and result: Code Display

Thanks in advance, Chris.

I've tried multiple field types and various options to try to force update, all to no avail.

ccfpcl
  • 3
  • 1
  • Welcome to [Stack Overflow.](https://stackoverflow.com/ "Stack Overflow") This is not a code-writing or tutoring service. We help solve specific, technical problems, not open-ended requests for code or advice. Please edit your question to show what you have tried so far, and what specific problem you need help with. See the [How To Ask a Good Question](https://stackoverflow.com/help/how-to-ask "How To Ask a Good Question") page for details on how to best help us help you. **DO NOT** post images of code, links to code, data, error messages, etc. - copy or type the text into the question. – itprorh66 Nov 12 '22 at 16:11
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 13 '22 at 01:35

1 Answers1

0

Something wrong

  • sg.Window(...).read() not return window, but event, values. It also block the execution until an event happened. It looks the only event is to close the window, then the GUI cannot be updated after window destroyed.
  • window[key].update(...) return None, None don't have method read to call. Method update won't update the GUI, but the configuration in PySimpleGUI.
  • Should update the GUI in the event loop where the window.read called after any actions for specific event.
  • time.sleep(30) will get the GUI no response for 30 seconds.
Jason Yang
  • 11,284
  • 2
  • 9
  • 23