struct mola::gui::TextBox

Overview

An editable single-line text field.

initial_value sets the displayed text at construction. on_change receives the new string (from the GUI thread); return true to accept the edit (nanogui convention; ImGui always accepts).

nanogui : nanogui::TextBox (editable, left-aligned). ImGui : ImGui::InputText with a 512-byte internal buffer; on_change fired when the buffer differs from the last committed value.

#include <GuiWidgetDescription.h>

struct TextBox
{
    // fields

    std::string label;
    std::string initial_value;
    int font_size = 0;
    std::function<bool(std::string)> on_change;
};

Fields

std::string label

shown beside the field

std::function<bool(std::string)> on_change

Called from GUI thread.