Choose the position of the call-tip.
(self)
| 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." |