Skip to content

Tooltip ​

tooltip · Overlays · interactive

A tooltip, shown while its anchor is hovered.

Import ​

cpp
#include "gbui/widgets/tooltip.hpp"

Example ​

Nothing is downloaded until you press it.

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 ​

OptionTypeDefaultWhat it does
maxWidthfloat260.0f
delayfloat0.4fHow 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.
wrapbooltrueA long tooltip wraps rather than eliding — a description cut off at an ellipsis is worse than no description.

Released under the LGPL-3.0-or-later licence.