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

Function _calltip_window

Lib/idlelib/calltip_w.py:172–194  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

170
171
172def _calltip_window(parent): # htest #
173 from tkinter import Toplevel, Text, LEFT, BOTH
174
175 top = Toplevel(parent)
176 top.title("Test call-tips")
177 x, y = map(int, parent.geometry().split('+')[1:])
178 top.geometry("250x100+%d+%d" % (x + 175, y + 150))
179 text = Text(top)
180 text.pack(side=LEFT, fill=BOTH, expand=1)
181 text.insert("insert", "string.split")
182 top.update()
183
184 calltip = CalltipWindow(text)
185 def calltip_show(event):
186 calltip.showtip("(s='Hello world')", "insert", "end")
187 def calltip_hide(event):
188 calltip.hidetip()
189 text.event_add("<<calltip-show>>", "(")
190 text.event_add("<<calltip-hide>>", ")")
191 text.bind("<<calltip-show>>", calltip_show)
192 text.bind("<<calltip-hide>>", calltip_hide)
193
194 text.focus_set()
195
196
197if __name__ == '__main__':

Callers

nothing calls this directly

Calls 11

insertMethod · 0.95
bindMethod · 0.95
ToplevelClass · 0.90
TextClass · 0.90
CalltipWindowClass · 0.85
titleMethod · 0.45
splitMethod · 0.45
packMethod · 0.45
updateMethod · 0.45
event_addMethod · 0.45
focus_setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…