Shuffled around parms in calls to Button so that Button can be called by user. Changed all MsgBox calls to Popup
This commit is contained in:
parent
91a3178c7b
commit
53db1545d8
19 changed files with 212 additions and 86 deletions
|
@ -4,17 +4,16 @@ import PySimpleGUI as sg
|
|||
# If want to use the space bar, then be sure and disable the "default focus"
|
||||
|
||||
with sg.FlexForm("Keyboard Test", return_keyboard_events=True, use_default_focus=False) as form:
|
||||
text_elem = sg.Text("", size=(18,1))
|
||||
layout = [[sg.Text("Press a key or scroll mouse")],
|
||||
[text_elem],
|
||||
[sg.SimpleButton("OK")]]
|
||||
[sg.Text("", size=(18,1), key='text')],
|
||||
[sg.SimpleButton("OK", key='OK')]]
|
||||
|
||||
form.Layout(layout)
|
||||
# ---===--- Loop taking in user input --- #
|
||||
while True:
|
||||
button, value = form.Read()
|
||||
|
||||
if button == "OK" or (button is None and value is None):
|
||||
text_elem = form.FindElement('text')
|
||||
if button in ("OK", None):
|
||||
print(button, "exiting")
|
||||
break
|
||||
if len(button) == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue