[wxPython-users] On a multi-select tree control, two slow single-clicks grab selected node

Andrea Gavana andrea.gavana at gmail.com
Fri Jun 2 02:47:19 PDT 2006


Hello Matt,

    I received your emails about CustomTreeCtrl, but your email adress seems
unreachable (at least for gmail). BTW, these are my comments:

> There were some differences between the way your tree control works and
> the way that the wxPython one does. Mainly this had to do with calls
> like GetNextChild, etc. Your control returns None when it is out of
> children/siblings/etc., while the one that comes with wx returns an item
> whose .IsOk() member function returns False.

There is no IsOk() method for CustomTreeCtrl. I mean, there is a
function called IsOk(), but it always return True. This is because, in
Python, there is no need to create a non-existing child item just to
have IsOk() returning False. If the item exist, the item is Ok.
Otherwise you will get None.

> The other thing was that
> programmatic selection didn't seem to work quite right. I overrode the
> SelectItem method to look like this:
>
>    def SelectItem(self, item, select=True):
>        if select:
>            CustomTreeCtrl.CustomTreeCtrl.SelectItem(self, item, False)
>        CustomTreeCtrl.CustomTreeCtrl.SelectItem(self, item, select)
>
> where the de-selection before selection seemed to be necessary to get
> the selection to take.

Mhm, I wasn't aware of this one... do you mean that the selection
from the code (and not with the mouse or the keyboard) doesn't work?
On which platforms?

> I really am impressed with this control. We've been developing a product
> using wxPython for a couple of years now and have so often wished for a
> tree that had checkboxes or could display other widgets inline with the
> items.

I am happy you find it useful!

> One other tiny thing I noticed: we had an event handler consuming mouse
> move events, but not calling event.skip() and this effectively disabled
> dragging items. Perhaps you should call event.skip() in your move event
> handler?
>

Mhm, it seems to me that I am already calling event.Skip() in the move
event handler... at least I can see it in the code :-)
There should be something missing somewhere else... if you could find
where it is (or provide an example) I will fix it.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.virgilio.it/infinity77/




More information about the wxpython-users mailing list