MCPcopy Index your code
hub / github.com/python/cpython / showtip

Method showtip

Lib/idlelib/tooltip.py:26–45  ·  view source on GitHub ↗

display the tooltip

(self)

Source from the content-addressed store, hash-verified

24 self.hidetip()
25
26 def showtip(self):
27 """display the tooltip"""
28 if self.tipwindow:
29 return
30 self.tipwindow = tw = Toplevel(self.anchor_widget)
31 # show no border on the top level window
32 tw.wm_overrideredirect(1)
33 try:
34 # This command is only needed and available on Tk >= 8.4.0 for OSX.
35 # Without it, call tips intrude on the typing process by grabbing
36 # the focus.
37 tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w,
38 "help", "noActivates")
39 except TclError:
40 pass
41
42 self.position_window()
43 self.showcontents()
44 self.tipwindow.update_idletasks() # Needed on MacOS -- see #34275.
45 self.tipwindow.lift() # work around bug in Tk 8.5.18+ (issue #24570)
46
47 def position_window(self):
48 """(re)-set the tooltip's screen position"""

Callers 3

open_calltipMethod · 0.45
_show_eventMethod · 0.45

Calls 6

position_windowMethod · 0.95
showcontentsMethod · 0.95
ToplevelClass · 0.85
wm_overrideredirectMethod · 0.80
update_idletasksMethod · 0.80
callMethod · 0.45

Tested by 1