[Gtk-sharp-list] removing childrens of a node in treeview

Rampage atomikramp at email.it
Thu Aug 19 03:44:44 EDT 2010



Christopher David Howie wrote:
> 
> On 08/18/2010 07:57 PM, Rampage wrote:
> 
> This is untested, but should work:
> 
> ----------8<----------
> private static void RemoveAllChildren(TreeModel model, TreeIter node)
> {
>     TreeIter child;
> 
>     if (model.IterChildren(out child, node)) {
>         // There are children.
> 
>         // Get the depth of the parent node so we know when to stop.
>         int depth = model.IterDepth(node);
> 
>         while (model.Remove(ref child) &&
>                model.IterDepth(child) > depth);
>     }
> }
> ----------8<----------
> 
> 

Thank you very much for the reply, i cant test this untill this evening
(CET) couse the proggy i'm working on is a free time project.

i'll try this method and let you know.

thanks again
-- 
View this message in context: http://mono.1490590.n4.nabble.com/removing-childrens-of-a-node-in-treeview-tp2330349p2330780.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.


More information about the Gtk-sharp-list mailing list