2018-10-26 01:30:08 +00:00
|
|
|
#!/usr/bin/env python
|
2019-10-23 20:10:03 +00:00
|
|
|
import PySimpleGUI as sg
|
|
|
|
|
|
|
|
'''
|
|
|
|
Parallel windows executing.
|
|
|
|
'''
|
2018-10-26 01:30:08 +00:00
|
|
|
|
|
|
|
layout1 = [[ sg.Text('Window 1') ],
|
2019-10-23 20:10:03 +00:00
|
|
|
[sg.Input('')],
|
2018-10-29 00:01:03 +00:00
|
|
|
[ sg.Button('Read')]]
|
2018-10-26 01:30:08 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window1 = sg.Window('My new window', layout1, location=(800,500))
|
2018-10-26 01:30:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
layout2 = [[ sg.Text('Window 2') ],
|
2019-10-23 20:10:03 +00:00
|
|
|
[sg.Input('')],
|
2018-10-29 00:01:03 +00:00
|
|
|
[ sg.Button('Read')]]
|
2018-10-26 01:30:08 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window2 = sg.Window('My new window', layout2, location=(800, 625), return_keyboard_events=True)
|
2018-10-26 01:30:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
layout3 = [[ sg.Text('Window 3') ],
|
|
|
|
[sg.Input(do_not_clear=False)],
|
2018-10-29 00:01:03 +00:00
|
|
|
[ sg.Button('Read')]]
|
2018-10-26 01:30:08 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window3 = sg.Window('My new window', layout3, location=(800,750), return_keyboard_events=True)
|
2018-10-26 01:30:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
while True: # Event Loop
|
2019-10-23 20:10:03 +00:00
|
|
|
event, values = window1.read(timeout=0)
|
2018-10-26 01:30:08 +00:00
|
|
|
if event is None:
|
|
|
|
break
|
|
|
|
elif event != '__timeout__':
|
|
|
|
print(event, values)
|
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
event, values = window2.read(timeout=0)
|
2018-10-26 01:30:08 +00:00
|
|
|
if event is None:
|
|
|
|
break
|
|
|
|
elif event != '__timeout__':
|
|
|
|
print(event, values)
|
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
event, values = window3.read(timeout=0)
|
2018-10-26 01:30:08 +00:00
|
|
|
if event is None:
|
|
|
|
break
|
|
|
|
elif event != '__timeout__':
|
|
|
|
print(event, values)
|
2019-10-23 20:10:03 +00:00
|
|
|
|
|
|
|
window1.close()
|
|
|
|
window2.close()
|
|
|
|
window3.close()
|