Is it possible to have checkboxes appear for only certain nodes in wxTreeListCtrl? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
escanor
Earned a small fee
Earned a small fee
Posts: 14
Joined: Sun Jun 10, 2018 1:57 am

Is it possible to have checkboxes appear for only certain nodes in wxTreeListCtrl?

Post by escanor »

Hi all,

wxTreeListCtrl allows for checkboxes inside a nested tree structure; however, I do not want to have checkboxes for every node in the tree.
If I set the wxTL_CHECKBOX flag it enables checkboxes for ALL nodes. Is there anyway to disable checkboxes for some of the nodes?
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Is it possible to have checkboxes appear for only certain nodes in wxTreeListCtrl?

Post by New Pagodi »

No. If you don't need columns, you can a regular tree control and use the state image to emulate checkboxes. I wrote an example of doing that here.
escanor
Earned a small fee
Earned a small fee
Posts: 14
Joined: Sun Jun 10, 2018 1:57 am

Re: Is it possible to have checkboxes appear for only certain nodes in wxTreeListCtrl?

Post by escanor »

Thank you so much, I always knew I could do this but I was unsure about a few small details. Your code was invaluable and I have full functionality now :D
Post Reply