Button background image

3,930 views
Skip to first unread message

Juan Carlos

unread,
Nov 13, 2011, 9:44:42 PM11/13/11
to Kivy users support
Hi, i'm new in kivy and python, and, i would like to nkow how to put a
background image into a kivy's button. I tried getting the canvas from
the button and putting on it a texture, i tried with an image too, but
it doesn't work.

Thanks for your time.

Mathieu Virbel

unread,
Nov 14, 2011, 2:30:28 AM11/14/11
to kivy-...@googlegroups.com
Hi Juan,

Check background_down and background_normal properties on a Button:
http://kivy.org/docs/api-kivy.uix.button.html#kivy.uix.button.Button.background_down

You can set them to add a different background when the button is pushed
or not.
It's a border image by default, if you don't want that, set the border
property to (0, 0, 0, 0)

Mathieu

Le 14/11/2011 03:44, Juan Carlos a �crit :

Juan Carlos

unread,
Nov 14, 2011, 5:40:56 PM11/14/11
to Kivy users support
Thanks a lot, thats what i was looking for.

On 14 nov, 02:30, Mathieu Virbel <m...@kivy.org> wrote:
> Hi Juan,
>
> Check background_down and background_normal properties on a Button:http://kivy.org/docs/api-kivy.uix.button.html#kivy.uix.button.Button....

Unknown

unread,
Jun 15, 2017, 6:04:43 PM6/15/17
to Kivy users support
I looked at this answer and I'm still confused. I set  button_down_normal: 'Images\buttonnotpressed.png'. this however does not display my png image.

Leonardo Rodriguez

unread,
Jun 15, 2017, 7:32:34 PM6/15/17
to Kivy users support
I think you need the background_normal property and not button_down_normal
Reply all
Reply to author
Forward
0 new messages