Radio
radio · Elements · interactive
One option of a group.
Import
cpp
#include "gbui/widgets/radio.hpp"Example
cpp
bool radio(Ui& ui, const Interaction& input, std::string_view id, bool selected, const RadioOptions& options = {});Returns true on the frame it was chosen; a radio that is already selected reports nothing, because choosing it again is not a change.
API
RadioOptions
| Option | Type | Default | What it does |
|---|---|---|---|
disabled | bool | false | |
label | std::string_view | ||
name | std::string_view | What a reader is told this is, when the label is not it. The label by default, which is right whenever there is one. Needed where the words are drawn beside the control rather than by it — a row that lays out its own caption and passes an empty label — because then there is nothing for the control to borrow and "switch, on" is all a reader gets. | |
size | float | 0.0f | Zero takes the active design's size. |