Tooltip
tooltip · Overlays · interactive
A tooltip, shown while its anchor is hovered.
Import
cpp
#include "gbui/widgets/tooltip.hpp"Example
cpp
void tooltip(Ui& ui, const Interaction& input, std::string_view anchorId, std::string_view text, const TooltipOptions& options = {});Draws nothing when the anchor is not hovered, so the call can sit unconditionally beside the control it describes.
API
TooltipOptions
| Option | Type | Default | What it does |
|---|---|---|---|
maxWidth | float | 260.0f | |
delay | float | 0.4f | How long the pointer must rest on the anchor first, in seconds. Without one, dragging the pointer across a toolbar flashes a tooltip for every control it passes over, which is noise rather than help. Needs an animator for the clock; with none, the tooltip shows at once and behaves as it always did. |
wrap | bool | true | A long tooltip wraps rather than eliding — a description cut off at an ellipsis is worse than no description. |