Closed dimmv2 closed 4 months ago
Can you please provide a minimal example that reproduces your issue. I can't reproduce.
here you can see this : keep your mouse on tooltip and after juste move it out .
import tkinter as tk
from tktooltip import ToolTip
root = tk.Tk()
root.title("Right-Click Menu Example")
root.geometry("400x300") # Set the size of the root window
userinfo = tk.Label(root, text="User Info")
userinfo.pack(pady=10)
tooltip_bg_color = "yellow"
ToolTip(userinfo, msg="Actual User", delay=0.5, fg="black", follow=True, bg=tooltip_bg_color)
root.mainloop()
@dimmv2 I cannot reproduce the behaviour you described with the provided MWE. I tried on Linux and MacOS, with Python versions 3.10 to 3.12.
That likely means that either there is something wrong with your tk
installation/machine or there is a bug in your code.
From what I saw in your uploaded animation, you might be overriding your widget's bindings somewhere else.
If you have a MWE that can reproduce this in an another machine or a containerised (controlled) environment, let me know, but I suspect the problem is coming from elsewhere.
@gnikit
i have test it right now on other pc with this config :
tkinter-tooltip-3.1.0 Python 3.10.4 win11
and i confirm that with my last mini example,the windows lost focus, when you move out the mouse from tooltip
Check that GIF, the problem is recorder right here .
same problem with : Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:1)
tkinter-tooltip-3.1.0 - "Disappear bug"
sometimes when you hover over the tooltip(button or label ) , and move the mouse out , the full GUI goes to back (lost focus )
demo of bug : ToolTip(userinfo, msg="Actual User",delay=0.5,fg="black",follow=False, bg=tooltip_bg_color) # dissparaid bug
i have found the solution to this : root.after(250, lambda: ToolTip(userinfo, msg="Actual User", delay=0.5, fg="black", follow=True, bg=tooltip_bg_color)) # fix for desaparition of main gui
maybe you can add these options directly to "tkinter-tooltip"