Skip to content

Commit 25f28b6

Browse files
authored
Merge pull request #187 from nicola02nb/patch-1
2 parents 35a752b + c7e9ee3 commit 25f28b6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

async_tkinter_loop/mixins.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
import asyncio
12
import sys
23
import tkinter as tk
34

45
from async_tkinter_loop import async_mainloop
56

67

78
class AsyncTk:
8-
def async_mainloop(self: tk.Tk) -> None:
9-
async_mainloop(self)
9+
def async_mainloop(self: tk.Tk, event_loop: asyncio.AbstractEventLoop | None = None) -> None:
10+
async_mainloop(self, event_loop=event_loop)
1011

1112

1213
class AsyncCTk(AsyncTk):
13-
def async_mainloop(self) -> None:
14+
def async_mainloop(self, event_loop: asyncio.AbstractEventLoop | None = None) -> None:
1415
# Based on the code from CustomTkinter by Tom Schimansky
1516
# Source https://github.com/TomSchimansky/CustomTkinter/blob/d719950f80eb2768db96bd4cc627523e99603b1b/customtkinter/windows/ctk_tk.py#L155
1617
if not self._window_exists:
@@ -22,4 +23,4 @@ def async_mainloop(self) -> None:
2223

2324
self._window_exists = True
2425

25-
super().async_mainloop()
26+
super().async_mainloop(event_loop=event_loop)

0 commit comments

Comments
 (0)