Basic Hover Tooltip for Tkinter based off of Tkinter's built in tooltip with the added ability to customize most options
pip install --upgrade Custom-Tooltip
https://pypi.org/project/Custom-Tooltip/
pip uninstall Custom-Tooltip
Example:
from custom_hovertip import CustomTooltipLabel
CustomTooltipLabel(anchor_widget=button1, text="This is tooltip text for button1.")
Full Example:
from tkinter import *
from custom_hovertip import CustomTooltipLabel
top = Tk()
top.title("Test Custom Tooltip")
label = Label(top, text="Place your mouse over buttons")
label.pack()
button1 = Button(top, text="Button 1")
button1.pack()
CustomTooltipLabel(anchor_widget=button1, text="This is tooltip text for button1.")
button2 = Button(top, text="Button 2")
button2.pack()
CustomTooltipLabel(anchor_widget=button2, text="This is tooltip\ntext for button2.", background="grey",
foreground="black", width=15, justify=CENTER)
top.mainloop()
You only have to define the widget it's anchored to as well as the text. You can see this example under button1
References to the Label Widget: https://www.tutorialspoint.com/python/tk_label.htm and https://www.pythontutorial.net/tkinter/tkinter-label/
Options that can be changed are:
justify, foreground, background, relief, font, wraplength, anchor, border, width, textvariable