Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : TreeNode + colums #460

Closed
ghost opened this issue Dec 28, 2015 · 3 comments
Closed

Question : TreeNode + colums #460

ghost opened this issue Dec 28, 2015 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 28, 2015

Hi,

I try to have a multi-colums tree, and here is what I got for now 👍
tree

There are 3 problems:

  • all the "locked" icons are not aligned on the same colums
  • The column only appear for the last node
  • how can I set the default column position for the lock icon ?

Here is my code :

ImGui::Columns(2, "tree items");

ImGui::TreeNode(...);

ImGui::NextColumn();

ImGui::PushFont(GetIconFont());
ImGui::TextUnformatted(UIStyle::Icon_Lock.c_str());
ImGui::PopFont();

Thanks

@ocornut
Copy link
Owner

ocornut commented Dec 28, 2015

all the "locked" icons are not aligned on the same colums

This was fixed a few weeks ago, afaik. Are you using latest?

1.47
Columns: Fixed bug with indentation within columns,

@ocornut
Copy link
Owner

ocornut commented Dec 28, 2015

The column only appear for the last node

Hard to tell why, the code you posted is incomplete. Maybe you are calling Columns(2) multiple time and that reset the start Y position of the columns set?

how can I set the default column position for the lock icon ?

You can use SetColumnOffset(). However if the only thing you are doing here is displaying an Icon Lock and you don't aim to resize the column much, using SameLine(xxx); instead of columns may just be simpler and faster.

@ghost
Copy link
Author

ghost commented Dec 28, 2015

Right, same line do the trick. Thanks Omar !

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant