ToolTip#
ToolTip is a helper that ttkbootstrap ships (ttk.ToolTip) — a
semi-transparent popup that shows text while the pointer hovers over a target
widget, and hides on leave or click. It is not a widget: you attach one to a
target by passing that widget to the constructor, and it manages its own hover
events thereafter.
Options#
Options are passed to the constructor and can be changed later with
configure() (read back with cget()).
Option |
Type |
Description |
|---|---|---|
|
|
The target widget the tooltip is attached to and positioned over. |
|
|
The text shown in the tooltip. Default |
|
|
The style applied to the tooltip label — any standard label style.
Default |
|
|
Padding between the text and the tooltip border. Default |
|
|
Alignment of multi-line text: |
|
|
Width in screen units before the text wraps. Default |
|
|
Milliseconds to hover before the tooltip appears. Default |
|
|
An optional image shown below the text. Default |
|
|
Placement relative to the widget — a space-separated combination of
|
|
|
Passed to the popup |
Methods#
- show_tip()
Create and show the tooltip window. Called automatically on hover; call it directly to show the tooltip programmatically.
- Returns:
None.
- hide_tip()
Hide the tooltip window.
- Returns:
None.
- move_tip()
Reposition the tooltip to track the pointer or the configured anchor.
- Returns:
None.
- destroy()
Release the tooltip: cancel pending timers, drop the popup, and unbind its handlers from the target widget. Idempotent; called automatically when the target widget is destroyed.
- Returns:
None.
See also#
ToolTip catalog page — usage, screenshots, and examples.