The thread that communicates with the application through the window's events. Waits for data from a queue and sends that data on to the event loop :param window: :param thread_queue: :return:
(window:sg.Window, thread_queue:queue.Queue)
| 91 | |
| 92 | |
| 93 | def the_thread(window:sg.Window, thread_queue:queue.Queue): |
| 94 | """ |
| 95 | The thread that communicates with the application through the window's events. |
| 96 | Waits for data from a queue and sends that data on to the event loop |
| 97 | :param window: |
| 98 | :param thread_queue: |
| 99 | :return: |
| 100 | """ |
| 101 | |
| 102 | while True: |
| 103 | data = thread_queue.get() |
| 104 | window.write_event_value((THREAD_KEY, THREAD_INCOMING_DATA), data) # Data sent is a tuple of thread name and counter |
| 105 | |
| 106 | |
| 107 | def main(): |
no test coverage detected