Displaying a tree of data (is wx.dataview.DataViewTreeCtrl the right choice?)


I’d like to display a simple tree of data in a wxpython application. Screen reader accessibility is a must have, so native controls are strongly preferred.

Is the wx.dataview.DataViewTreeCtrl the right choice for this, and if so is it supported in Python? If so, could someone please provide a simple example (I can only find C examples)? Thanks in advance!


Have you tried wxdemo already?
There are many examples in the showcase on the tree, so you can choose the one that suits you best.

  • The launcher is “/Scrips/wxdemo.exe” in the directory where Python is installed.
  • Once launched, the demo code will be expanded to “~\AppData\Local\wxPython\wxPython-demo-4.x.x\demo”.