On 26 January 2010 18:58, Doriano Blengino
<doriano.bleng...@fastwebnet.it> wrote:
> Benoît Minisini ha scritto:
>>> Benoît,
>>>
>>> Just for that you should go with the GTK+ way :P
>>>
>>> Regards,
>>> Dimitris
>>>
>>>
>>
>> But is it really useful? We need to know how many root items a TreeView or a
>> ColumnView has, too!
>>
>>
> What about using two different properties: .Count (all the items) and
> .Children.Count (only the children of a specific node)?
> Note that by using only the second property it is possible to calculate
> the first one by scanning the children and summing up; if only one
> property has to be in existence, then the second one is more versatile
> and probably more needed in common situations.

A better idea might be to add a Nodes property.

' Count root nodes only:
NodesCount = tvMine.Nodes.Count
'Count a node's child nodes by passing the node as a parameter:
NodesCount = tvMine.Nodes[SomeHigherNode].Count

As for having two properties, the only other reason I could imagine
needing another count property is to count how many items _could_ be
visible within the current object's immediate display area. Could be,
not are.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to