> 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.
Thanks Mathias but I must be doing something wrong.
I created my group with ( after frame = wx.Frame(...); canvas =
floatcanvas.NavCanvas(frame,...) ):
group = canvas.create( 'Group', name = 'test' )
And I add objects like that:
line = canvas.create('Line', (0,0), (200,200), name='Line1',
look=('blue', ''), parent = group)
arc = canvas.create('Arc', 100, 0, 45*3.14/180, False,(0,0),
name='Arc1', look=('red', ''), parent = group)
Then, I use the mouse to select a group and delete it.
The event.node seems to return the group node, but I am only able to
delete the children of the group if I do the following:
for child in event.node.children:
canvas.removeChild(child)
The command event.node.removeAllChildren() does not work
In fact, I am ok with that, but the only problem is that although I
removed all children from the canvas, the group itself seems to be
still there (when I pass the mouse over the former area of the group,
my function still shows the object with the name of the group even if
there is nothing there).
I think I probably would like to delete any remains of the group in my canvas.
Is there a way of doing that with the event.node object?
Marcos
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas