Struct TextBox

Struct Documentation

struct TextBox

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.

Public Members

std::string label

shown beside the field

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

Called from GUI thread.