title: Kivy-- Image as Button
body: <p>I am just beginner in kivy and object oriented programming.</p>
  
  <p>I have been practicing this code as a combination of the tutorials here:</p>
  
  <pre><code>from kivy.uix.behaviors import ButtonBehavior  
  from kivy.uix.image import Image  
  from kivy.lang import Builder  
  from kivy.app import App  
  from kivy.uix.floatlayout import FloatLayout  
  
  Builder.load_string("""  
  &lt;ImageButton&gt;:  
      FloatLayout:  
          Image:  
              source:'resizedA.png'  
              size_hint: .2, .2  
  """)  
  
  class ImageButton(ButtonBehavior,FloatLayout, Image):  
      def on_press(self):  
          print ('pressed')
  
  
  class The_AssignmentApp(App):  
      def build(self):  
          return ImageButton()  
  
  if __name__ == "__main__":  
      The_AssignmentApp().run()  
  </code></pre>
  
  <p>My question is, why is that even if I press the other parts of the screen(not the image), the app still considers the whole scree as a button?</p>
  
  <p>Pardon my ignorance here, I would really want to learn. Thanks!</p>