I am just beginner in kivy and object oriented programming.
I have been practicing this code as a combination of the tutorials here:
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("""
<ImageButton>:
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()
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?
Pardon my ignorance here, I would really want to learn. Thanks!