This commit is contained in:
MikeTheWatchGuy 2018-10-21 21:34:53 -04:00 committed by GitHub
parent d75044f702
commit e28652a548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 54 deletions

View File

@ -39,9 +39,8 @@ window = sg.Window('My new window', default_element_size=(12, 1), auto_size_text
i = 0
while True: # Event Loop
event, value = window.ReadNonBlocking()
if event == 'Exit':
window.CloseNonBlocking()
event, value = window.Read(timeout=400)
if event == 'Exit' or event is None:
break
if value is None:
break
@ -50,5 +49,3 @@ while True: # Event Loop
SetLED(window, '_ram_', 'green' if random.randint(1, 10) > 5 else 'red')
SetLED(window, '_temp_', 'green' if random.randint(1, 10) > 5 else 'red')
SetLED(window, '_server1_', 'green' if random.randint(1, 10) > 5 else 'red')
time.sleep(.400)