CustomTreeCtrl

Hello,
how you take all select checkbox in CustomTreeCtrl?

You can iterate over the nodes in the tree and use IsItemChecked to determine if they should be added to the list of checked items. Or if you can find it via google somebody has probably already written a generator that can do this for you...

···

On 2/8/12 5:57 AM, rose9392@hotmail.it wrote:

Hello,
how you take all select checkbox in CustomTreeCtrl?

--
Robin Dunn
Software Craftsman

Hi,

Hello,
how you take all select checkbox in CustomTreeCtrl?

There is currently nothing built-in in CustomTreeCtrl (although I will
need to add something like that, as this question came up quite a few
times in the past). However, you can use something like this
(supposing that "self" is an instance of CustomTreeCtrl):

def GetCheckedItems(self, itemParent=None, checkedItems=None):

     if itemParent is None:
         itemParent = self.GetRootItem()

     if checkedItems is None:
         checkedItems =

     child, cookie = self.GetFirstChild(itemParent)

     while child:

         if self.IsItemChecked(child):
             checkedItems.append(child)

         checkedItems = self.GetCheckedItems(child, checkedItems)
         child, cookie = self.GetNextChild(itemParent, cookie)

     return checkedItems

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 8 February 2012 14:57, rose9392@hotmail.it wrote: