creating an Iphone calculator Button

56 views
Skip to first unread message

The_Ethical_Boy

unread,
Jul 7, 2022, 4:23:14 AM7/7/22
to Kivy users support
I will like to know how I could create such buttons using Kivy.
Can anyone help me?
iCalculator.PNG

Elliot Garbus

unread,
Jul 7, 2022, 9:16:42 AM7/7/22
to kivy-...@googlegroups.com

There are 2 ways I can think of to do this.  My first choice would be to combine an Image with ButtonBehavior to create a Button with a Custom Image.

See: https://kivy.org/doc/stable/api-kivy.uix.behaviors.button.html?highlight=buttonbehavior#example

 

The other way to do it would be to combine ButtonBehavior with a Label, and use the Canvas to draw a filled circle.  The on_press and on_release events could be used to change the color.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/59b7ada8-23e9-4698-9d7b-0b59c389273en%40googlegroups.com.

 

The_Ethical_Boy

unread,
Jul 7, 2022, 10:18:45 PM7/7/22
to Kivy users support
Thanks for your approach, i will try it out.

There is (i think) another interesting way of doing this, but i will equally need your help for that.
My idea is replacing the 'icon' stuffs from MDFloatingActionButton or MDIconButton to 'Label' stuffs.

Can you please help me?

Elliot Garbus

unread,
Jul 8, 2022, 12:06:05 AM7/8/22
to kivy-...@googlegroups.com

The Icon buttons are using Unicode characters for the icons.  If you look in the source code you can find the dictionary that holds all the icons.

 

Looking at the behavior of the calculator, and the animation, I would use the combine ButtonBehavior with a Label, and use the Canvas to draw a filled circle.

 

Try any approach you like, if you run into trouble ask questions.

Reply all
Reply to author
Forward
0 new messages