virtual tree control?

Is there a way to separate the actual data tree from its graphical
representation? Like the virtual list control.

(I know I could implement this myself, but I'm wondering if there's a
special class, or an easy way to do it with wxTreeCtrl.)

We'd be interested in the answer to this question as well.

In the mean time, we built a simplified version of a
virtual wxTreeListCtrl based on the expand and collapse
events. Data is added to the tree list at expansion and
deleted when the tree list is collapsed. That is not
quite what a true virtual control would provide, but it
is workable for our specific case.

/Jean Brouwers

Scott wrote:

···

Is there a way to separate the actual data tree from its graphical
representation? Like the virtual list control.

(I know I could implement this myself, but I'm wondering if there's a
special class, or an easy way to do it with wxTreeCtrl.)

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Scott wrote:

Is there a way to separate the actual data tree from its graphical
representation? Like the virtual list control.

(I know I could implement this myself, but I'm wondering if there's a
special class, or an easy way to do it with wxTreeCtrl.)

Not quite as virtual as the listctrl, but you can get close. The wxTreeCtrl does not require you to preload all the tree nodes into it, only those that need to be visible. If an item has children but you don't want to load them yet, (for whatever reason) then you can just call SetItemHasChildren and the tree will draw the item with the little [+] button or whatever. Then when the user tries to expand that node you can catch the EVT_TREE_ITEM_EXPANDING event and add the child nodes at that time. You can also remove the children in response to a EVT_TREE_ITEM_COLLAPSING event if you want.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!