Another timeout change, make show button do nothing except refresh

This commit is contained in:
MikeTheWatchGuy 2018-12-01 15:49:39 -05:00
parent 153c9a1b92
commit a37583fb06
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ window = sg.Window('Window Title', return_keyboard_events=True).Layout(layout)
sel_item = -1 sel_item = -1
skip_event = False skip_event = False
while True: # Event Loop while True: # Event Loop
event, values = window.Read(timeout=0) event, values = window.Read(timeout=500)
if event is None or event == 'Exit': if event is None or event == 'Exit':
break break
if event != sg.TIMEOUT_KEY: if event != sg.TIMEOUT_KEY:
@ -80,7 +80,7 @@ while True: # Event Loop
sel_item = sel_item - (sel_item>0) sel_item = sel_item - (sel_item>0)
list_elem.Update(set_to_index=sel_item) list_elem.Update(set_to_index=sel_item)
skip_event = True skip_event = True
if event == '\r' or event == 'Show': if event == '\r':
chosen = vals2['_FLOATING_LISTBOX_'] chosen = vals2['_FLOATING_LISTBOX_']
window.Element('_INPUT_').Update(vals2['_FLOATING_LISTBOX_'], select=True) window.Element('_INPUT_').Update(vals2['_FLOATING_LISTBOX_'], select=True)
fwindow.Close() fwindow.Close()