Merge pull request #1273 from PySimpleGUI/Dev-latest
Made Window 1 a blocking Read
This commit is contained in:
commit
bfc616e080
|
@ -1,6 +1,6 @@
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
layout = [[ sg.Text('Window 1'),],
|
layout = [[sg.Text('Window 1'), ],
|
||||||
[sg.Input(do_not_clear=True)],
|
[sg.Input(do_not_clear=True)],
|
||||||
[sg.Text('', key='_OUTPUT_')],
|
[sg.Text('', key='_OUTPUT_')],
|
||||||
[sg.Button('Next >'), sg.Button('Exit')]]
|
[sg.Button('Next >'), sg.Button('Exit')]]
|
||||||
|
@ -9,7 +9,8 @@ win1 = sg.Window('Window 1').Layout(layout)
|
||||||
|
|
||||||
win3_active = win2_active = False
|
win3_active = win2_active = False
|
||||||
while True:
|
while True:
|
||||||
ev1, vals1 = win1.Read(timeout=100)
|
if not win2_active:
|
||||||
|
ev1, vals1 = win1.Read()
|
||||||
if ev1 is None or ev1 == 'Exit':
|
if ev1 is None or ev1 == 'Exit':
|
||||||
break
|
break
|
||||||
win1.FindElement('_OUTPUT_').Update(vals1[0])
|
win1.FindElement('_OUTPUT_').Update(vals1[0])
|
||||||
|
@ -38,8 +39,10 @@ while True:
|
||||||
|
|
||||||
if win3_active:
|
if win3_active:
|
||||||
ev3, vals3 = win3.Read()
|
ev3, vals3 = win3.Read()
|
||||||
if ev3 in (None, 'Exit', '< Prev'):
|
if ev3 == '< Prev':
|
||||||
win3.Close()
|
win3.Close()
|
||||||
win3_active = False
|
win3_active = False
|
||||||
win2_active = True
|
win2_active = True
|
||||||
win2.UnHide()
|
win2.UnHide()
|
||||||
|
elif ev3 in (None, 'Exit'):
|
||||||
|
break
|
||||||
|
|
Loading…
Reference in New Issue