[wxPython] Moving/copying a branch within wxTreeCtrl

I appreciate the example at

http://lists.wxwindows.org/pipermail/wxpython-users/2001-May/005517.html

However, although it indicates how to handle drag-and-drop wn a wxTreeCtrl
it seems to me that the following code must lose the children of the
dragged node.

    def OnEndDrag(self, evt):
        itemSrc = self.draggingItem
        itemDst = evt.GetItem()
        self.draggingItem = None

        if not itemDst.IsOk():
            print "Can't drag to here..."
            return

        text = self.tree.GetItemText(itemSrc)
        self.tree.AppendItem(itemDst, text)
        self.tree.Delete(itemSrc)

If this is so then what is the best way of making the dragged branch a child
of the destination branch (short of reconstructing the entire branch)? I have
looked through the doc and googled but I'm stumped.

Thanks for your help.

Bill

I appreciate the example at

http://lists.wxwindows.org/pipermail/wxpython-users/2001-May/005517.html

However, although it indicates how to handle drag-and-drop wn a wxTreeCtrl
it seems to me that the following code must lose the children of the
dragged node.

Yep.

If this is so then what is the best way of making the dragged branch a

child

of the destination branch (short of reconstructing the entire branch)? I

have

looked through the doc and googled but I'm stumped.

Currently you have to reconstruct the subtree. There was talk on wx-devel a
while back about adding some code so this would be easy to do but I havn't
seen any code yet. (It would have taken some significant changes to
wxTreeCtrl.)

···

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