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)
192
192
end
193
193
194
194
# Tk: (Tkinter/tkinter module)
195
+ # based on https://github.com/ipython/ipython/blob/7.0.1/IPython/terminal/pt_inputhooks/tk.py
195
196
function Tk_eventloop (sec:: Real = 50e-3 )
196
197
Tk = pyimport (tkinter_name ())
198
+ _tkinter = pyimport (" _tkinter" )
199
+ flag = _tkinter[:ALL_EVENTS ] | _tkinter[:DONT_WAIT ]
200
+ root = PyObject (nothing )
197
201
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
199
206
if root. o != pynothing[]
200
- pycall (root[" update" ], PyObject)
207
+ while pycall (root[" dooneevent" ], Bool, flag)
208
+ end
201
209
end
202
210
end
203
211
end
You can’t perform that action at this time.
0 commit comments