title: Kivy draw on a widget
body: <p>I am new to Kivy and after I have done the tutorials my next step was to add the two tutorial's widgets in one application. The class CombWidget will be my Widget to which the Paint and PingPong widgets will bne added to. For an intermediate step a BoxLayout was added and</p>
  
  <ol>
  <li>a few Buttons</li>
  <li>MyPaintWidget</li>
  </ol>
  
  <p>in the BoxLayout.</p>
  
  <p>To restrict the drawing only to MyPaintWidget a if statement was added</p>
  
  <pre><code>def on_touch_move(self, touch):
      if self.collide_point(touch.x, touch.y):
          touch.ud['line'].points += [touch.x, touch.y]
  </code></pre>
  
  <p>The line are drawn only to a small spot just above the buttons. The dot are draw everywhere except on the Buttons. The Buttons also don't react to clicks any more.</p>
  
  <p>The code:</p>
  
  <pre><code>from random import random
  from kivy.app import App
  from kivy.graphics import Color, Ellipse, Line
  from kivy.uix.button import Button
  from kivy.uix.widget import Widget
  
  class CombWidget(Widget):
      pass
  class MyPaintWidget(Widget):
  
  def on_touch_down(self, touch):
      color = (random(), 1, 1)
      with self.canvas:
          Color(*color, mode='hsv')
          d = 30.
          Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
          touch.ud['line'] = Line(points=(touch.x, touch.y))
  
  def on_touch_move(self, touch):
      if self.collide_point(touch.x, touch.y):
          touch.ud['line'].points += [touch.x, touch.y]
  
  class MyPaintApp(App):       
      def build(self):
          return CombWidget()
  
  if __name__ == '__main__':
      MyPaintApp().run()
  </code></pre>
  
  <p>and the layout file:</p>
  
  <pre><code>#:kivy 1.7.0
  
  
  &lt;CombWidget&gt;:
      BoxLayout:
          orientation: 'vertical'
          padding: 20
          spacing: 50
  
          MyPaintWidget:
              size: 100000, 100000
              size_hint: 100000, 100000
  
          Button:
              text: "Hallo"
          Button:
              text: "Hallo 1"
          Button:
              text: "Hallo 2"
  </code></pre>
  
  <p>To increase the size of MyPaintWidget I used the size: and size_hint: parameters in the kv file but not success.</p>
  
  <p>Can anybody help met to increase the size of MyPaintWidget so that that area behaves just like the MyPaintyApp the in tutorial. Also why does my buttons show when you click on them.</p>
  
  <p>Regards</p>