title: How to update the on_touch_move and on_touch_down methods of a Widget in kivy
body: <p>I am currently working on creating a paint app and I am using a Widget canvas for that purpose.
  Basically I have defined methods to create straight lines and curve_line. But the problem is I can't switch between these two methods. meaning I have two buttons to trigger these methods and each method bind the widget with <code>on_touch_down</code> and <code>on_touch_move</code> methods. My problem is first time as soon as the app starts running and for example I clicked button with name <code>f hand</code> it works fine and after that once i clicked the next button the widget bind itself with both methods creating a mess.... now i want that the widget should bind itself with only one method at a time .. how can i achieve this..</p>
  <p>my python code is here</p>
  <pre><code>import kivy
  from kivy.uix.widget import Widget
  from kivy.uix.widget import Canvas
  from kivy.graphics import Color
  from kivy.graphics import Line
  from kivy.uix.floatlayout import FloatLayout
  from kivy.app import App
  from kivy.uix.button import Button
  
  class Main(FloatLayout):
  
  
      def __init__(self,**kwargs):
          super(Main, self).__init__(**kwargs)
  
          self.my_widget = Widget(size_hint= (0.6,0.6),pos_hint = {'x':0.5,'top' : 0.8})
          self.add_widget(self.my_widget)
  
          self.free_hand = Button(text='f_hand',pos_hint = {'x':0.04,'top':0.2},size_hint = (0.12,0.12))
          self.add_widget(self.free_hand)
          self.free_hand.bind(on_press = self._free_hand)
  
          self._hand = Button(text='s_hand', pos_hint={'x': 0.04, 'top': 0.6}, size_hint=(0.12, 0.12))
          self.add_widget(self._hand)
          self._hand.bind(on_press=self._straight_lines)
  
  
      def _free_hand(self,instance):
  
  
          def on_touch_downah(self,touch):
              self.line = Line(points = (touch.x,touch.y),width = 5)
              self.canvas.add(self.line)
              '''self.line_list.append(self.line)
              print(self.line_list)'''
          
          def on_touch_moveah(self,touch):
              self.line.points += touch.x,touch.y
  
          self.my_widget.bind(on_touch_down=on_touch_downah)
          self.my_widget.bind(on_touch_move=on_touch_moveah)
  
      def _straight_lines(self,instance):
  
          def on_touch_downeh(self, touch):
              self.x_ = touch.x
              self.y_ = touch.y
              self.lines = Line(points=(touch.x,touch.y),width = 5)
              self.canvas.add(self.lines)
  
          def on_touch_moveeh(self, touch):
              self.x2 = self.x_ + 0.1
              self.y2 = self.y_ + 0.1
              self.lines.points = (self.x_,self.y_,self.x2,self.y2,touch.x,touch.y)
  
          self.my_widget.bind(on_touch_down=on_touch_downeh)
          self.my_widget.bind(on_touch_move=on_touch_moveeh)
  
  
  '''
      def undo_1(self):
          self.i -= 1
          k = self.line_list[self.i]
          self.canvas.remove(k)
  '''
  
  class Myapp(App):
      def build(self):
          return Main()
  
  Myapp().run()
  </code></pre>
  <p>Any help is greatly appreciated .</p>