HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
GUI System

System

Window

Widget

Label

++
widget.make_widget<label_widget>("A1", l10n("My Text"));

Button

++
auto button = wiget.make_widget<button_widget<bool>>("A1", true);
button->label = label{elusive_icon::Wrench, l10n("Preferences")};
auto callback = button->subscribe([]{ foo(); });

Checkbox

The checkbox is configured with a true-value and a false-value, to match with the observed value.

When the observed value is equal to:

  • true-value: a checkmark is shown inside the box and the true_label is shown to the right of the box,
  • false-value: the box is empty and the false_label is shown to the right of the box,
  • neither: a dash is shown inside the box and the other_label is shown to the right of the box.

Each of these labels may be empty.

++
// Many button widget can work with custom types.
enum class value_t { A, B, C };
// A value which can be observed by widgets and other things.
observable<value_t> value;
// Create a check button: A is true, B is false, anything else is other.
auto button = widget.make_widget<checkbox_widget<value_t>>("A1", value_t::A, value_t::B, value);
// We can set a label for each checkbox value.
button->true_label = l10n("true");
button->false_label = l10n("false");
button->other_label = l10n("other");

Radio button

In ttauri a set of radio buttons are a set of tt::radio_button_widgets. Each of the widgets in a set observe the same value and each widget is configured with a different true-value.

When a tt::radio_button_widget's true-value matches the observed value the radio button is checked, otherwise it is unchecked. When a radio button is clicked the observed value is set to that widget's true value.

The label on the right side of a radio button is always shown, but the label may be set to empty to not show a label.

++
// Many button widget can work with custom types.
enum class value_t { A, B, C };
// A value which can be observed by widgets and other things.
observable<value_t> value;
// Create a radio button which is active on A, with the label "A"
auto button1 = widget.make_widget<radio_button_widget<value_t>>("A1", value_t::A, value, l10n("A"));
// Create a radio button which is active on B, with the label "B"
auto button2 = widget.make_widget<radio_button_widget<value_t>>("A2", value_t::B, value, l10n("B")));

Toggle

Text field

Selection

Row/Column layout

Grid layout

Tab View

Toolbar

Toolbar Tab Button

Menu Item