Kivy Clickable Image That Replaced A Button
Looking for a way to use an image instead of a conventional button with kivy. I try to use background_disabled_normal and background_disabled_down This is my button part in my .kv
Solution 1:
background_disabled_normal: str(False)
This should be a filepath to an image, not a string of a boolean. Also, this is the property for the background when the button's disabled property is True - are you sure you don't want background_normal
?
There is another way to do this anyway that may suit you; the button stuff is abstracted as ButtonBehavior that may be combined with any widget.
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.image import Image
classImageButton(ButtonBehavior, Image):
pass
This ImageButton will have all the properties of an image (you can set the source) and all the events of a button (on_press etc).
Post a Comment for "Kivy Clickable Image That Replaced A Button"