ccu.fancyplots._gui.tooltip¶
A robust tooltip class.
This module provides the Tooltip class.
- class ccu.fancyplots._gui.tooltip.Tooltip(parent: Widget | Widget, *, bg: str = '#000000', pad: tuple[float, float, float, float] = (5, 3, 5, 3), text: str = '', waittime: int = 400, wraplength: float = 250)[source]¶
Bases:
objectCreate a tooltip for a given widget as the mouse goes on it.
see:
- http://stackoverflow.com/questions/3221956/
what-is-the-simplest-way-to-make-tooltips- in-tkinter/36221216#36221216
- http://www.daniweb.com/programming/software-development/
code/484591/a-tooltip-class-for-tkinter
Originally written by vegaseat on 2014.09.09.
Modified to include a delay time by Victor Zaccardo on 2016.03.25.
- Variables:
parent – The widget over which the user must hover to activate the tooltip.
bg – The tooltip background as a hex string. Defaults to
"#FFFFEA".pad – A 4-tuple
(left, top, bottom, right), indicating the padding around the text within the tooltip (in pixels).text – The text displayed in the tooltip. Defaults to an empty string.
waittime – Time before displaying (in milliseconds). Defaults to
400.wraplength – Length before wrapping text (in pixels). Defaults to
250.
Create a tooltip.
- Parameters:
parent – The parent widget over which one must hover to generate the tooltip.
bg – The tooltip background. Defaults to “#FFFFEA”.
pad – The padding to use for the tooltip. Defaults to (5, 3, 5, 3).
text – The text to display on the tooltip. Defaults to “”.
waittime – The time (in milliseconds) to wait for a user to hover before generating the tooltip. Defaults to 400.
wraplength – The character length at which the tooltip message will wrap. Defaults to 250.