Better documented the difference between BeginListBox() and BeginChild() w/ ImGuiChildFlags_FrameStyle.

BeginListBox() can't yet expose child flags because coarse clipping require query of stored size (same issue as with adding resize support to Tables).
This commit is contained in:
ocornut
2023-11-07 20:14:54 +01:00
parent fa4c49b4a7
commit 44345c2108
4 changed files with 11 additions and 11 deletions

View File

@ -1250,6 +1250,9 @@ static void ShowDemoWindowWidgets()
IMGUI_DEMO_MARKER("Widgets/List Boxes");
if (ImGui::TreeNode("List boxes"))
{
// BeginListBox() is essentially a thin wrapper to using BeginChild()/EndChild() with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
// You may be tempted to simply use BeginChild() directly, however note that BeginChild() requires EndChild() to always be called (inconsistent with BeginListBox()/EndListBox()).
// Using the generic BeginListBox() API, you have full control over how to display the combo contents.
// (your selection data could be an index, a pointer to the object, an id for the object, a flag intrusively
// stored in the object itself, etc.)