MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / check_focus

Function check_focus

lib/matplotlib/tests/test_backend_tk.py:225–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 success = []
224
225 def check_focus():
226 tkcanvas = fig.canvas.get_tk_widget()
227 # Give the plot window time to appear
228 if not tkcanvas.winfo_viewable():
229 tkcanvas.wait_visibility()
230 # Make sure the canvas has the focus, so that it's able to receive
231 # keyboard events.
232 if tkcanvas.focus_lastfor() == tkcanvas:
233 success.append(True)
234 plt.close()
235 root.destroy()
236
237 root = tk.Tk()
238 fig = plt.figure()

Callers

nothing calls this directly

Calls 3

get_tk_widgetMethod · 0.80
closeMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…