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

Method get_position

Lib/idlelib/calltip_w.py:35–48  ·  view source on GitHub ↗

Choose the position of the call-tip.

(self)

Source from the content-addressed store, hash-verified

33 self.checkhide_after_id = None
34
35 def get_position(self):
36 """Choose the position of the call-tip."""
37 curline = int(self.anchor_widget.index("insert").split('.')[0])
38 if curline == self.parenline:
39 anchor_index = (self.parenline, self.parencol)
40 else:
41 anchor_index = (curline, 0)
42 box = self.anchor_widget.bbox("%d.%d" % anchor_index)
43 if not box:
44 box = list(self.anchor_widget.bbox("insert"))
45 # align to left of window
46 box[0] = 0
47 box[2] = 0
48 return box[0] + 2, box[1] + box[3]
49
50 def position_window(self):
51 "Reposition the window if needed."

Callers

nothing calls this directly

Calls 4

listClass · 0.85
splitMethod · 0.45
indexMethod · 0.45
bboxMethod · 0.45

Tested by

no test coverage detected