PAMLINUX@surfeu.ch wrote:
Hello everybody,
I would like to come back on this subject.
wxGenericDirCtrl provides GetPath method wich provide only the last selected
path.
wxTreeCtrl do provide multiple selection, but GetSelections method returns
a list [<C wxTreeItemId instance at _88dec98_wxTreeItemId_p>, ... ] of itemswhich are C++ pointers with no usable python method. This items are not
hashable, I mean it is not even possible to use them as a dict key to keep
trace of selected paths.
They are opaque handles (wrappers around the platform specific handle actually) to the items in the tree. You pass them to methods of the treecrtl to specify the item to deal with. Over time you may get different wxTreeItemIds for the same tree item because wxWindows creates them as needed.
the event methods (from function set with EVT_TREE_SEL_CHANGED) are no more
useful : GetLabel return empty string and GetId returns always the same
Id.
Did you read the docs on GetLabel? It is only used for begin/end label edit events. The GetId method will return the ID of the window that generated the event just like always (the tree in this case.) What you want to use is GetItem which will return the wxTreeItemId of the item affected by the event.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!