Major demo refresh.. switched everything to new function names, new design patterns

Out with the old, in with the new!!
This commit is contained in:
MikeTheWatchGuy 2018-09-24 18:01:00 -04:00
parent 2a06683383
commit a1f4c60271
68 changed files with 706 additions and 1863 deletions

View file

@ -1,21 +1,20 @@
import PySimpleGUI as sg
with sg.FlexForm("Realtime Keyboard Test", return_keyboard_events=True, use_default_focus=False) as form:
layout = [[sg.Text("Hold down a key")],
[sg.SimpleButton("OK")]]
layout = [[sg.Text("Hold down a key")],
[sg.Button("OK")]]
form.Layout(layout)
window = sg.Window("Realtime Keyboard Test", return_keyboard_events=True, use_default_focus=False).Layout(layout)
while True:
button, value = form.ReadNonBlocking()
while True:
button, value = window.ReadNonBlocking()
if button == "OK":
print(button, value, "exiting")
break
if button is not None:
if len(button) == 1:
print('%s - %s'%(button, ord(button)))
else:
print(button)
elif value is None:
break
if button == "OK":
print(button, value, "exiting")
break
if button is not None:
if len(button) == 1:
print('%s - %s'%(button, ord(button)))
else:
print(button)
elif value is None:
break