Creates a topoltip window with the tooltip text inside of it
(self)
| 904 | self.id = None |
| 905 | |
| 906 | def showtip(self): |
| 907 | """ |
| 908 | Creates a topoltip window with the tooltip text inside of it |
| 909 | """ |
| 910 | if self.tipwindow: |
| 911 | return |
| 912 | x = self.widget.winfo_rootx() + self.x + DEFAULT_TOOLTIP_OFFSET[0] |
| 913 | y = self.widget.winfo_rooty() + self.y + DEFAULT_TOOLTIP_OFFSET[1] |
| 914 | self.tipwindow = tk.Toplevel(self.widget) |
| 915 | # if not sys.platform.startswith('darwin'): |
| 916 | try: |
| 917 | self.tipwindow.wm_overrideredirect(True) |
| 918 | # if running_mac() and ENABLE_MAC_NOTITLEBAR_PATCH: |
| 919 | if _mac_should_apply_notitlebar_patch(): |
| 920 | self.tipwindow.wm_overrideredirect(False) |
| 921 | except Exception as e: |
| 922 | print('* Error performing wm_overrideredirect in showtip *', e) |
| 923 | self.tipwindow.wm_geometry("+%d+%d" % (x, y)) |
| 924 | self.tipwindow.wm_attributes("-topmost", 1) |
| 925 | |
| 926 | label = ttk.Label(self.tipwindow, text=self.text, justify=tk.LEFT, |
| 927 | background=TOOLTIP_BACKGROUND_COLOR, relief=tk.SOLID, borderwidth=1) |
| 928 | if TOOLTIP_FONT is not None: |
| 929 | label.config(font=TOOLTIP_FONT) |
| 930 | label.pack() |
| 931 | |
| 932 | def hidetip(self): |
| 933 | """ |
nothing calls this directly
no test coverage detected