You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DemoPrograms/Demo_Multithreaded_popup.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ def popup(*args, **kwargs):
28
28
ifmainthread_queue:
29
29
mainthread_queue.put((args, kwargs))
30
30
31
-
defthe_thread():
31
+
defthe_thread(count):
32
32
"""
33
33
The thread that communicates with the application through the window's events.
34
34
@@ -37,7 +37,7 @@ def the_thread():
37
37
i=0
38
38
whileTrue:
39
39
time.sleep(2)
40
-
popup('Hello, this is the thread', 'My counter value', i, text_color='white', background_color='red', non_blocking=True)
40
+
popup(f'Hello, this is the thread #{count}', 'My counter value', i, text_color='white', background_color='red', non_blocking=True, keep_on_top=True, location=(1000-200*count, 400))
41
41
i+=1
42
42
43
43
@@ -66,16 +66,17 @@ def main():
66
66
[sg.Input(key='-IN-', size=(30,1))],
67
67
[sg.B('Start A Thread'), sg.B('Dummy'), sg.Button('Exit')] ]
0 commit comments