mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-27 22:05:08 +00:00
Demo: use ImGui version of TreeNodeGetOpen/TreeNodeSetOpen + comments.
This commit is contained in:
@@ -6726,6 +6726,8 @@ bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char
|
||||
return TreeNodeBehavior(id, flags, label, label_end);
|
||||
}
|
||||
|
||||
// The reason those two functions are not yet in public API is because I would like to design a more feature-full and generic API for this.
|
||||
// They are otherwise function (cc: #3823, #9251, #7553, #6754, #5423, #2958, #2079, #1947, #1131, #722)
|
||||
bool ImGui::TreeNodeGetOpen(ImGuiID storage_id)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
@@ -6733,11 +6735,11 @@ bool ImGui::TreeNodeGetOpen(ImGuiID storage_id)
|
||||
return storage->GetInt(storage_id, 0) != 0;
|
||||
}
|
||||
|
||||
void ImGui::TreeNodeSetOpen(ImGuiID storage_id, bool open)
|
||||
void ImGui::TreeNodeSetOpen(ImGuiID storage_id, bool is_open)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage;
|
||||
storage->SetInt(storage_id, open ? 1 : 0);
|
||||
storage->SetInt(storage_id, is_open ? 1 : 0);
|
||||
}
|
||||
|
||||
bool ImGui::TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags)
|
||||
|
||||
Reference in New Issue
Block a user