Virtual Tree List Control Question

I am using a Virtual Tree List to show a summary that is a hierarchy
with several columns. I am using a virtual tree control since I like
using the Tree Model to store the data separate form the Tree
Control. I like this because I am envisioning having several views of
the tree - so I will have have several Tree Controls that share a
single Tree Model.

However, I also wanted to have a separate "detail" screen that will
show a detail form for the selected item in the list. How can I do
this?

I have tried to bind the event "EVT_TREE_SEL_CHANGED". But inside the
event handler, how can I figure out which item in the Tree Model is
selected? I can only seem to figure out how to get the item in the
Tree Control, but from there, I cannot figure out how to branch over
to which item is selected in the Tree Model.

Help will be appreciated.

Hi Robert,

I have tried to bind the event "EVT_TREE_SEL_CHANGED". But inside the
event handler, how can I figure out which item in the Tree Model is
selected? I can only seem to figure out how to get the item in the
Tree Control, but from there, I cannot figure out how to branch over
to which item is selected in the Tree Model.

I'm assuming you're using wx.lib.mixins.treemixin.VirtualTree, hope
that's correct. VirtualTree has wx.lib.mixins.treemixin.TreeHelper as
a superclass so you can use TreeHelper's methods (see
wxPython API Documentation — wxPython Phoenix 4.2.2 documentation)
to get an "index" of the tree item. The "index" is actually a tuple of
indices that form a "path" to the item. E.g the first child child of
the second child of the third root item has index (2,1,0). It's the
same index that VirtualTree uses to get the text (OnGetItemText) and
attributes of items in the tree.

Cheers, Frank

···

2009/10/21 Robert <talklikeaduck@gmail.com>:

That was exactly what I was looking for! Thanks!

This is the type of thing that I have trouble figuring out on my own.
Any advice how I could have figured this out on my own (tutorials,
documentation, ...) I would also appreciate.

Did you look at the wxPython demo?

Cheers, Frank

···

2009/10/21 Robert <talklikeaduck@gmail.com>:

That was exactly what I was looking for! Thanks!

This is the type of thing that I have trouble figuring out on my own.
Any advice how I could have figured this out on my own (tutorials,
documentation, ...) I would also appreciate.

Yes, but unless I missed it this wasn't shown in the demo.

···

On Oct 21, 1:52 pm, Frank Niessink <fr...@niessink.com> wrote:

2009/10/21 Robert <talklikead...@gmail.com>:

> That was exactly what I was looking for! Thanks!

> This is the type of thing that I have trouble figuring out on my own.
> Any advice how I could have figured this out on my own (tutorials,
> documentation, ...) I would also appreciate.

Did you look at the wxPython demo?

Cheers, Frank