ListCtrl, selection, MS Windows
Basil Shubin
bashu at yandex.ru
Mon Jan 1 23:53:37 PST 2007
Robin Dunn пишет:
> Basil Shubin wrote:
>> Happy New Year!
>>
>> For the provided source code example, I have discover some strange
>> behavior. On linux box, selection works as it should be work, but
>> under windows when I select item in list control, the selection first
>> shown, but then disappear. I don't understand why it's work fine under
>> Linux/GTK, but fail under Windows... Please, I need help in tracing
>> this issue.
>
> It probably has something to do with the fact that every time something
> is selected you are removing all the items from the list and adding them
> again. So the selection happens and then you delete all items
> (including the selected one) and then try to select it again. Then the
> mouse up event happens and the native control processes that in whatever
> way it does, and since the original item selected on the mouse down
> doesn't exist any more then it deselects the current selection. I bet
> if you don't remove and re-add all the contents upon the selection event
> then things will work fine.
Thanks for this suggestion, it helps me to solve this issue!
--
Basil Shubin
Freelance Software Developer
http://bashu.wordpress.com
More information about the wxpython-users
mailing list