Struct TextPanel
Defined in File GuiWidgetDescription.h
Struct Documentation
-
struct TextPanel
A multi-line text panel.
Read-only mode:
nanogui : a non-editable nanogui::TextBox with vertical scroll, or a sequence of nanogui::Label lines inside a scroll panel. Content is refreshed from
live_texteach spinOnce tick.ImGui : ImGui::InputTextMultiline with ImGuiInputTextFlags_ReadOnly. live_text->pollIntoDisplay() is called each frame; the widget reads display directly. No copy into a separate buffer needed because ReadOnly mode does not write back.
Editable mode:
nanogui : nanogui::TextBox (multiline variant) with setEditable(true). on_change fires when the user commits (focus lost / Enter).
ImGui : ImGui::InputTextMultiline with a caller-owned std::string buffer (ImGui 1.89+ supports std::string via InputTextCallback or the imgui_stdlib.h helper - use InputTextMultiline overload that takes std::string*). on_change fires every frame the content differs from the last committed snapshot.
size_pixelssets the widget’s (width, height) in pixels. {0, 0} means “fill available width, auto height” for ImGui (ImVec2(0,0) default) and a reasonable fixed size for nanogui.When
editableis false,on_changeis ignored and may be left empty. Wheneditableis true,live_textis still used for the initial content (set it before calling create_subwindow_from_description); after that the ImGui backend owns the buffer andlive_textis not polled. The nanogui backend follows the same convention.