#4024 closed defect (outdated)
wxTreeCtrl with single selection, selects more then 1 item
Reported by: | g00fy | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | wxMSW | Version: | |
Keywords: | wxTreeCtrl | Cc: | g00fy |
Blocked By: | Blocking: | ||
Patch: | no |
Description
wxTreeCtrl -> just the default sample.
Please apply the attached patch.
VS 2005/1
Win2K/4
CVS
I think this is an MSW bug, because the API-calls return all success (like they should do, but they don't do it).
Now what don't they do?
The attached patch will select the rootitem when creating the tree. Upon selchange, it will expand the selected item.
This works nice for the rootitem, but if you select another item, you notice that the selection of the rootitem is not moved.
Also when you do GetSelections(), you get "2" as a result. Very weird indeed under a tree with the wxTR_MULTIPLE NOT set...
Solving this can be done with selecting the rootitem again, and selecting the other element...
Greetz,
Steven
Attachments (3)
Change History (8)
Changed 11 years ago by g00fy
comment:1 Changed 11 years ago by g00fy
comment:2 Changed 10 years ago by wojdyr
- Component set to wxMSW
- Keywords wxTreeCtrl added
Changed 5 years ago by catalin
Changed 5 years ago by catalin
comment:3 Changed 5 years ago by catalin
The reported behaviour does not happen in 2.9svn. Neither the one in comment:1.
There are a couple of small improvements to the sample in the last patch.
comment:4 Changed 5 years ago by vadz
- Resolution set to outdated
- Status changed from new to closed
another thing is if you do UnselectAll() followed by a select( <item> ); it will not remove any selection, but just select the new one...
Even if you add wxYield() between the calls.
Hope this helps for finding a solution :)