From c8b3c57d80c089b7abf30aa3a160202ae2071069 Mon Sep 17 00:00:00 2001 From: Rick Lawson Date: Fri, 13 Oct 2023 13:27:34 -0400 Subject: [PATCH] Tooltips go off-screen #1224 consolidate code --- porcupine/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/porcupine/utils.py b/porcupine/utils.py index c42bb78f4..92cf58fd5 100644 --- a/porcupine/utils.py +++ b/porcupine/utils.py @@ -174,11 +174,9 @@ def show(self) -> None: # colors at all or both foreground and background. Otherwise # the label will have light text on a light background or # dark text on a dark background on some systems. - label = tkinter.Label(tipwindow, text=self.text, border=3, fg="black", bg="white") - label.pack() + tkinter.Label(tipwindow, text=self.text, border=3, fg="black", bg="white").pack() tipwindow.update() - tw_width = tipwindow.winfo_width() - tipwindow.geometry(f"+{self.mousex - tw_width}+{self.mousey - 30}") + tipwindow.geometry(f"+{self.mousex - tipwindow.winfo_width()}+{self.mousey - 30}") def set_tooltip(widget: tkinter.Widget, text: str) -> None: