Renamed return value from Read call from button to event... EVERYWHERE
This commit is contained in:
parent
43526e0182
commit
c79a8772cc
86 changed files with 7992 additions and 12709 deletions
|
@ -43,19 +43,19 @@ def TestMenus():
|
|||
|
||||
# ------ Loop & Process button menu choices ------ #
|
||||
while True:
|
||||
button, values = window.Read()
|
||||
if button is None or button == 'Exit':
|
||||
event, values = window.Read()
|
||||
if event is None or event == 'Exit':
|
||||
return
|
||||
print('Button = ', button)
|
||||
print('Event = ', event)
|
||||
# ------ Process menu choices ------ #
|
||||
if button == 'About...':
|
||||
window.Hide()
|
||||
if event == 'About...':
|
||||
# window.Hide()
|
||||
sg.Popup('About this program','Version 1.0', 'PySimpleGUI rocks...', grab_anywhere=True)
|
||||
window.UnHide()
|
||||
elif button == 'Open':
|
||||
# window.UnHide()
|
||||
elif event == 'Open':
|
||||
filename = sg.PopupGetFile('file to open', no_window=True)
|
||||
print(filename)
|
||||
elif button == 'Properties':
|
||||
elif event == 'Properties':
|
||||
SecondForm()
|
||||
|
||||
TestMenus()
|
Loading…
Add table
Add a link
Reference in a new issue