You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need a tree with selectable nodes. The current tree does not allow this. I have try using "Selectable+Indent" as leaf and normal tree node for inner nodes but:
only the selectable are "selectable"
the selectables (even with Indent) are not well aligned with the tree node.
So, I think to create my own TreeNode like widget, here is my current code:
bool SelectableTreeNode(const char* label, bool isSelected, bool hasChildren)
{
// Selection
if (isSelected)
{
ImU32 col = ImColor(ImGui::GetStyle().Colors[ImGuiCol_HeaderHovered]);
/*x += os.x;
y += os.y;
ImGui::RenderFrame(ImVec2(x, y), ImVec2(x + itemFullWidth, y + itemFullHeight), col, true, 3.f);
x -= os.x;
y -= os.y;*/
}
ImGui::PushID(label);
const bool opened = ImGui::CollapsingHeader(label, "", false);
ImGui::PopID();
if (opened)
ImGui::TreePush(label);
return opened;
}
But how can I :
know the area of the treenode (see RenderFrame)
Hide the Triangle/Arrow based on the "hasChildren" parameter
Any idea ?
The text was updated successfully, but these errors were encountered:
Hi,
I need a tree with selectable nodes. The current tree does not allow this. I have try using "Selectable+Indent" as leaf and normal tree node for inner nodes but:
So, I think to create my own TreeNode like widget, here is my current code:
But how can I :
Any idea ?
The text was updated successfully, but these errors were encountered: