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

Method checkhide_event

Lib/idlelib/calltip_w.py:88–113  ·  view source on GitHub ↗

Handle CHECK_HIDE_EVENT: call hidetip or reschedule.

(self, event=None)

Source from the content-addressed store, hash-verified

86 self.label.pack()
87
88 def checkhide_event(self, event=None):
89 """Handle CHECK_HIDE_EVENT: call hidetip or reschedule."""
90 if not self.tipwindow:
91 # If the event was triggered by the same event that unbound
92 # this function, the function will be called nevertheless,
93 # so do nothing in this case.
94 return None
95
96 # Hide the call-tip if the insertion cursor moves outside of the
97 # parenthesis.
98 curline, curcol = map(int, self.anchor_widget.index("insert").split('.'))
99 if curline < self.parenline or \
100 (curline == self.parenline and curcol <= self.parencol) or \
101 self.anchor_widget.compare("insert", ">", MARK_RIGHT):
102 self.hidetip()
103 return "break"
104
105 # Not hiding the call-tip.
106
107 self.position_window()
108 # Re-schedule this function to be called again in a short while.
109 if self.checkhide_after_id is not None:
110 self.anchor_widget.after_cancel(self.checkhide_after_id)
111 self.checkhide_after_id = \
112 self.anchor_widget.after(CHECKHIDE_TIME, self.checkhide_event)
113 return None
114
115 def hide_event(self, event):
116 """Handle HIDE_EVENT by calling hidetip."""

Callers

nothing calls this directly

Calls 7

hidetipMethod · 0.95
position_windowMethod · 0.95
after_cancelMethod · 0.80
afterMethod · 0.80
splitMethod · 0.45
indexMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected