Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
Bug report
Bug description:
Minimal Reproducible Example
importtkinterastkfromidlelib.tooltipimportHovertiproot=tk.Tk()root.geometry('200x100')label=tk.Label(root,text='Hover Me!')label.pack()tip=Hovertip(label,text='Pro Tip')root.mainloop()
Proposed Fix
Specifying a foreground color, e.g.foreground="black"
, at theLabel
declaration inHovertip.showcontents()
fixes the issue
classHovertip(OnHoverTooltipBase):"A tooltip that pops up when a mouse hovers over an anchor widget."def__init__(self,anchor_widget,text,hover_delay=1000):"""Create a text tooltip with a mouse hover delay. anchor_widget: the widget next to which the tooltip will be shown hover_delay: time to delay before showing the tooltip, in milliseconds Note that a widget will only be shown when showtip() is called, e.g. after hovering over the anchor widget with the mouse for enough time. """super().__init__(anchor_widget,hover_delay=hover_delay)self.text=textdefshowcontents(self):label=Label(self.tipwindow,text=self.text,justify=LEFT,foreground="black",background="#ffffe0",relief=SOLID,borderwidth=1)label.pack()
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Done