Merge pull request #2761 from PySimpleGUI/Dev-latest

Removed check for 'Exit'
This commit is contained in:
PySimpleGUI 2020-04-02 10:58:12 -04:00 committed by GitHub
commit 16e36ea88b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -866,7 +866,7 @@ window = sg.Window('Pick a color', layout)
while True: # the event loop
event, values = window.read()
if event in (None, 'Exit'):
if event is None:
break
if event == 'Ok':
if values['-COLOR-']: # if something is highlighted in the list
@ -899,7 +899,7 @@ window = sg.Window('Pick a color', layout)
while True: # the event loop
event, values = window.read()
if event in (None, 'Exit'):
if event is None:
break
if values['-COLOR-']: # if something is highlighted in the list
sg.popup(f"Your favorite color is {values['-COLOR-'][0]}")