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

Robin Dunn robin at alldunn.com
Fri Jun 2 08:38:57 PDT 2006


Andrea Gavana wrote:
> 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.

Also, the wx.TreeItemId has a __nonzero__ method so you can check for 
validity of the item without calling IsOk.  This means that this code 
will work for either the wx treeitems or for Andrea's:

	if item:
		self.DoSomething()

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list