diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e8c587 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Manifest.toml +.CondaPkg diff --git a/src/pygui.jl b/src/pygui.jl index b719d45..2776c86 100644 --- a/src/pygui.jl +++ b/src/pygui.jl @@ -191,12 +191,15 @@ function Tk_eventloop(sec::Real=50e-3) flag = _tkinter.ALL_EVENTS | _tkinter.DONT_WAIT root = pynothing = Py(nothing) install_doevent(sec) do async - new_root = Tk._default_root - if pyconvert(Bool, new_root != pynothing) - root = new_root - end - if pyconvert(Bool, root != pynothing) - while pyconvert(Bool, root.dooneevent(flag)) + @show typeof(Tk) + if pyhasattr(Tk, "_default_root") + new_root = Tk._default_root + if pyconvert(Bool, new_root != pynothing) + root = new_root + end + if pyconvert(Bool, root != pynothing) + while pyconvert(Bool, root.dooneevent(flag)) + end end end end