mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Refactored SetNextItemXXX stuff to match SetNextWindowXXX code closely.
This commit is contained in:
@ -568,13 +568,20 @@ static void ShowDemoWindowWidgets()
|
||||
if (ImGui::TreeNode("Basic trees"))
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
// Use SetNextItemOpen() so set the default state of a node to be open.
|
||||
// We could also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing!
|
||||
if (i == 0)
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
|
||||
if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i))
|
||||
{
|
||||
ImGui::Text("blah blah");
|
||||
ImGui::SameLine();
|
||||
if (ImGui::SmallButton("button")) { };
|
||||
if (ImGui::SmallButton("button")) {};
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user