File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -192,12 +192,20 @@ function wx_eventloop(sec::Real=50e-3)
192192end
193193
194194# Tk: (Tkinter/tkinter module)
195+ # based on https://github.com/ipython/ipython/blob/7.0.1/IPython/terminal/pt_inputhooks/tk.py
195196function Tk_eventloop (sec:: Real = 50e-3 )
196197 Tk = pyimport (tkinter_name ())
198+ _tkinter = pyimport (" _tkinter" )
199+ flag = _tkinter[:ALL_EVENTS ] | _tkinter[:DONT_WAIT ]
200+ root = PyObject (nothing )
197201 install_doevent (sec) do async
198- root = Tk[" _default_root" ]
202+ new_root = Tk[" _default_root" ]
203+ if new_root. o != pynothing[]
204+ root = new_root
205+ end
199206 if root. o != pynothing[]
200- pycall (root[" update" ], PyObject)
207+ while pycall (root[" dooneevent" ], Bool, flag)
208+ end
201209 end
202210 end
203211end
You can’t perform that action at this time.
0 commit comments