display the tooltip
(self)
| 24 | self.hidetip() |
| 25 | |
| 26 | def showtip(self): |
| 27 | """display the tooltip""" |
| 28 | if self.tipwindow: |
| 29 | return |
| 30 | self.tipwindow = tw = Toplevel(self.anchor_widget) |
| 31 | # show no border on the top level window |
| 32 | tw.wm_overrideredirect(1) |
| 33 | try: |
| 34 | # This command is only needed and available on Tk >= 8.4.0 for OSX. |
| 35 | # Without it, call tips intrude on the typing process by grabbing |
| 36 | # the focus. |
| 37 | tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w, |
| 38 | "help", "noActivates") |
| 39 | except TclError: |
| 40 | pass |
| 41 | |
| 42 | self.position_window() |
| 43 | self.showcontents() |
| 44 | self.tipwindow.update_idletasks() # Needed on MacOS -- see #34275. |
| 45 | self.tipwindow.lift() # work around bug in Tk 8.5.18+ (issue #24570) |
| 46 | |
| 47 | def position_window(self): |
| 48 | """(re)-set the tooltip's screen position""" |