I am trying to add tool tips into my Guizero app but I cant seem to combine them correctly. While I'm trying to minimize the amount of libraries I'm using if you can give me something else that works with Guizero that would be great too.
from tkinter import *
from tkinter.tix import *
from guizero import *
app=App(width=500,height=500)
#Create a tooltip
tip = Balloon(app)
app.add_tk_widget(Balloon)
#Create a Button widget
my_button=PushButton(app, text= "Hover Me")
#Bind the tooltip with button
tip.tk.bind_widget(my_button,balloonmsg="hovered text")
app.display()
What I'm using
- Python 3.10.4
- Guizero 1.3.0
- tkinter.tix
Have you looked into
idlelib.tooltip? I know that works with tkinter, it might well work with guizero.As I said, I'm not sure this will work with guizero out of the box, but it's worth a shot.
UPDATE: If you want to style the Hovertip, you can override the
Hovertipclass to include style attributes at__init__Now when you initialize a new
Hovertip, you can add parameter keywords to thetk.Labellike so