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: 10
Joined: Sun Jun 10, 2018 1:57 am

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

Post by escanor » Thu Jul 18, 2019 3:25 am

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: 307
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 » Thu Jul 18, 2019 5:12 am

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: 10
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 » Sun Jul 21, 2019 4:19 pm

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