From: <wxh...@al...> - 2004-05-19 16:30:36
|
> Well, when I tried your example, it first crashed on me! As I am using > a debug version, I quickly found out that the wxWidget code asserts that > an image list is present when dragging -- even when just using text > labels :-( > I just wonder whether that might cause you trouble. When I added images > (using > the filebrowse example images) everything worked -- of course, drags were > vetoed > so, nothing would happen. Hmm, doesn't crash on me. But I went ahead and added the images, but nothing changed. Note that I said try with and without the "veto", because I'm not sure it should really even be "veto". In the C++ version, you have to explicitly allow the dragging, because the default is not to drag, as evidenced in the wxWidgets sample program: void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event) { // need to explicitly allow drag if ( event.GetItem() != GetRootItem() ) { m_draggedItem = event.GetItem(); wxLogMessage(wxT("OnBeginDrag: started dragging %s"), GetItemText(m_draggedItem).c_str()); event.Allow(); } else { wxLogMessage(wxT("OnBeginDrag: this item can't be dragged.")); } } That's why I wasn't sure if the "veto" wasn't really this "event.Allow()" call. But it doesn't matter, because I try it both ways and neither way works. Any ideas? Thanks. |