Return from canvas.get_group() call in kivy
<p>Calling <code>get_group()</code> from an instruction group yields back more that what I wanted.</p>

<p>I have the following code:</p>

<pre><code>for widget in self.selected:
    dx, dy = (
        widget.pos[0] - self.pos[0],
        widget.pos[1] - self.pos[1]
    )
    self.shadows.add(Rectangle(size=widget.size, pos=widget.pos, group='my_shadows'))

self.canvas.add(self.shadows)

print self.shadows.get_group('my_shadows')
</code></pre>

<p>which in turn produces the following result:</p>

<pre><code>&lt;kivy.graphics.context_instructions.BindTexture object at 0x7ff992377050&gt;
&lt;kivy.graphics.vertex_instructions.Rectangle object at 0x7ff99493e638&gt;
&lt;kivy.graphics.context_instructions.BindTexture object at 0x7ff9923770e8&gt;
&lt;kivy.graphics.vertex_instructions.Rectangle object at 0x7ff99493e6e0&gt;
</code></pre>

<p>What are BindTextures and why are they returned through <code>get_group()</code>? I expected only Rectangles.
If i intend to manipulate my Rectangles, do I need to do the same with my BindTextures?</p>

<p>Maybe you've already noticed that with <code>Rectangle</code> you can set a background image of a Widget. That's what <a href="https://kivy.org/docs/api-kivy.graphics.html#kivy.graphics.BindTexture" rel="nofollow"><code>BindTexture</code></a> is for as it provides <code>source</code> parameter for a path to an image that can be used as a background.</p>

<p>If you don't intend to use those Rectangles as background images (from file, not drawing with <code>Color</code> + <code>Rectangle</code>), I think it is safe to ignore the textures.</p>

python kivy kivy-language