Tooltip❖
kivydk.uix.behavior.tooltip
Overview❖
TooltipBehavior does not create or manage tooltip widgets directly. Instead, it exposes a small set of properties that describe how a tooltip should be rendered and positioned. TooltipManager reads these properties and applies the appropriate defaults or overrides when showing a tooltip for the widget.
Reference❖
- class TooltipBehavior(**kwargs)❖
Bases:
objectDeclarative behavior that adds tooltip configuration to widgets.
When a property is
None, TooltipManager falls back to its own default value. This allows widgets to customize only the aspects they need while preserving a consistent global tooltip style and behavior across the application.Events
Todo
The current event implementation relies on
__events__being defined as a class attribute. This works for now, but it overrides inherited Kivy events.When revisiting the event system, consider migrating to
register_event_type()and updating the DocLang command to support dynamically registered events.on_tooltipCalled after the tooltip’s visibility state changes.
on_pre_tooltipCalled before the tooltip’s visibility state changes.
- tooltip_text: StringProperty❖
Text content displayed inside the tooltip.
Default value❖""
- tooltip_markup: BooleanProperty❖
Whether
tooltip_textshould be interpreted as markup.Default value❖False
- tooltip_side: OptionProperty❖
Preferred placement side for the tooltip relative to the widget.
TooltipManager resolves this preference and selects the final side based on available screen space.
Options
This attribute accepts only the following options:
"auto""cursor""left""top""right""bottom"Default value❖None
- tooltip_offset: NumericProperty❖
Additional offset
(in pixels)applied between the tooltip and its anchor position (widget or cursor).Default value❖None
- tooltip_template: ObjectProperty❖
Custom widget class or instance used to render the tooltip.
Default value❖None
- tooltip_interactive: BooleanProperty❖
Enable interactive tooltip instead of auto‑hiding hover hints.
Warning
Tooltip interaction is only partially implemented.
The
"cursor"tooltip side is partially supported, and"auto"may select"cursor"internally, resulting in same incomplete behavior.Default value❖None