struct mola::gui::ComboBox
Overview
A drop-down / combo-box (“pick one of N”).
items - display strings shown in the list. initial_index - zero-based index of the initially selected item. on_change - called with the new index from the GUI thread.
nanogui : nanogui::ComboBox; fixed_width (if > 0) via setFixedWidth(). ImGui : ImGui::Combo; fixed_width (if > 0) via SetNextItemWidth(), otherwise defaults to ImGui ‘s item width (which scales with the window, so long option labels grow the widget on resize).
#include <GuiWidgetDescription.h> struct ComboBox { // fields std::string label; std::vector<std::string> items; int initial_index = 0; std::function<void(int)> on_change; int fixed_width = 0; };
Fields
int fixed_width = 0
0 = auto (toolkit default)