Hi Jonathan,
thanks for replying. Meanwhile I solved the problem and I think it has nothing to do with #626.
As I wrote before, there was a problem in my particular application, because the treectrl sample worked just fine if I set my custom wxTreeCtrl style to it.
After a lot of debugging I found the bug. My tree was rebuilt every time the user pressed a certain button. I did this by calling DeleteAllItems() in the first place. My tree had the wxTR_HIDE_ROOT style, so this call also deleted the root. Since I did not realize this at that time (because the root was not displayed anyway), I did not call AddRoot() when rebuilding the tree, but only AppendItem() to a root that was already deleted…
I think at this point, wxWidgets should have complained that the first parameter passed to AppendItem() is not ok. It did not. Instead, the selection in the tree worked badly.
So, the only change I made for this to work was to call DeleteChildren(myRoot) instead of DeleteAllItems().
Hope this story will help someone
Regards,
Cristina.
···
On Thu, Apr 16, 2009 at 6:29 PM, Jonathan Liu wrote:
Public cai wrote:
after upgrading to wxWidgets 2.8.10, the way the selection in my
wxTR_MULTIPLE wxTreeCtrl works, changed. But it still doesn’t work
properly, i.e. every clicked item in the tree gets selected without
holding Shift or Ctrl!
Have you checked whether it works in wxWidgets 2.9 SVN?
I have made several fixes for wxTreeCtrl which have been applied in the
2.9 SVN version. The ticket for these fixes was #626
(http://trac.wxwidgets.org/ticket/626).
Regards,
Jonathan