Handle CHECK_HIDE_EVENT: call hidetip or reschedule.
(self, event=None)
| 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.""" |
nothing calls this directly
no test coverage detected