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

Tree of checkboxes - any examples? #1995

Open
srk opened this issue Mar 18, 2023 · 1 comment
Open

Tree of checkboxes - any examples? #1995

srk opened this issue Mar 18, 2023 · 1 comment

Comments

@srk
Copy link

srk commented Mar 18, 2023

Hello,
I want to make a tree of check boxes, that looks like this:

All types [ ]
|
|-Type A [ ]
| |
| A1 [ ]
| A2 [ ]
| A3 [ ]
|-Type B [ ]
| |
| B1 [ ]
| B2 [ ]
|- Type C [ ]

If 'All types' is checked, then all sub-checkboxes are checked
If 'Type A' is checked, then all sub-checkboxes (i.e. A1,A2 ..) are checked

I eventually want these checkboxes to control the individual and grouped visibility of sets of points3d objects, held in a list.

Can anyone point me to an example of how to do this with TreeEditor?

@corranwebster
Copy link
Contributor

This isn't easily doable with the TreeEditor - it doesn't expose a checkbox as part of the API for the items in the tree.

The Pyface data_view can expose checkboxes easily using a ValueType with a get_check_state/set_check_state, but needs work to embed in a TraitsUI as it works at the lower Pyface level and we don't yet have an example of doing that embedding - it can be done with a CustomEditor reasonably simply but there isn't an example that you can follow.

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

No branches or pull requests

2 participants