-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathDemo_Multiple_Windows_Experimental.py
More file actions
54 lines (37 loc) · 1.22 KB
/
Copy pathDemo_Multiple_Windows_Experimental.py
File metadata and controls
54 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
import PySimpleGUI as sg
'''
Parallel windows executing.
Copyright 2018-2026 PySimpleGUI. All rights reserved.
'''
layout1 = [[ sg.Text('Window 1') ],
[sg.Input('')],
[ sg.Button('Read')]]
window1 = sg.Window('My new window', layout1, location=(800,500))
layout2 = [[ sg.Text('Window 2') ],
[sg.Input('')],
[ sg.Button('Read')]]
window2 = sg.Window('My new window', layout2, location=(800, 625), return_keyboard_events=True)
layout3 = [[ sg.Text('Window 3') ],
[sg.Input(do_not_clear=False)],
[ sg.Button('Read')]]
window3 = sg.Window('My new window', layout3, location=(800,750), return_keyboard_events=True)
while True: # Event Loop
event, values = window1.read(timeout=0)
if event == sg.WIN_CLOSED:
break
elif event != '__timeout__':
print(event, values)
event, values = window2.read(timeout=0)
if event == sg.WIN_CLOSED:
break
elif event != '__timeout__':
print(event, values)
event, values = window3.read(timeout=0)
if event == sg.WIN_CLOSED:
break
elif event != '__timeout__':
print(event, values)
window1.close()
window2.close()
window3.close()