'kivy.graphics.vertex_instructions.Rectangle' object has no attribute 'group'

1,285 views
Skip to first unread message

aldous99

unread,
Jul 9, 2012, 4:48:38 PM7/9/12
to kivy-...@googlegroups.com
In Python code I can add a group attribute to objects, and then selectively drop them from the context, like so:

Rectangle( source='myimage.png', pos=( self.size[0]/2,  self.size[1]/2), size=(self.cz, self.cz), group='ship')

...then later in my widget...

        self.canvas.remove_group('ship')

This works well for my use-case.  I'm trying to move some of the python code into a KV file, but this...

<CraftWidget>:
size: .5, .5
canvas:
Rectangle:
            source: 'myimage.png'
            pos: self.size[0]/2,  self.size[1]/2
            size: 100, 100 
            group: 'ship'

...results in the error: Rectangle object has no attribute 'group'

Please advise.

Mathieu Virbel

unread,
Jul 11, 2012, 5:12:25 PM7/11/12
to kivy-...@googlegroups.com
Hi,

Well, the "group" thing is a bug. Please report it seperately in github :)

But even if you could but a group, once you remove the group, it's done.
Why are you trying to do that?
Reply all
Reply to author
Forward
0 new messages