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

Function showtip

lib/matplotlib/backends/_backend_tk.py:973–992  ·  view source on GitHub ↗

Display text in tooltip window.

(event)

Source from the content-addressed store, hash-verified

971 tipwindow = None
972
973 def showtip(event):
974 """Display text in tooltip window."""
975 nonlocal tipwindow
976 if tipwindow or not text:
977 return
978 x, y, _, _ = widget.bbox("insert")
979 x = x + widget.winfo_rootx() + widget.winfo_width()
980 y = y + widget.winfo_rooty()
981 tipwindow = tk.Toplevel(widget)
982 tipwindow.overrideredirect(1)
983 tipwindow.geometry(f"+{x}+{y}")
984 try: # For Mac OS
985 tipwindow.tk.call("::tk::unsupported::MacWindowStyle",
986 "style", tipwindow._w,
987 "help", "noActivates")
988 except tk.TclError:
989 pass
990 label = tk.Label(tipwindow, text=text, justify=tk.LEFT,
991 relief=tk.SOLID, borderwidth=1)
992 label.pack(ipadx=1)
993
994 def hidetip(event):
995 nonlocal tipwindow

Callers

nothing calls this directly

Calls 1

geometryMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…