Am 26.04.2009, 14:29 Uhr, schrieb Marcos Duarte <[email protected]>:

> Hi Nitro,
>
> In FloatCanvas2, how do I delete a group?
> if I create a group with group = canvas.create( 'Group', name = "name"
> ) and add children to it, I tried to delete the children with
> something like (and its variations):
> x = group._getChildren()
> for i in range(len(x)):
>     canvas.removeChild(x[i])
>
> but it does not work...
> I am able to get all children but I can't delete them.
>
> thanks in advance

The children are not part of the canvas node, they are part of the group  
node. Simple solution for your problem:

group.removeAllChildren()

or with the code you gave above

for child in group.children:
     group.removeChild(child)

-Matthias

P.S.: Note that groups without (renderable) children are not allowed right  
now.
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to