Тёмный
No video :(

How To Create Rounded Buttons With Kivy - Python Kivy GUI Tutorial #22 

Codemy.com
Подписаться 233 тыс.
Просмотров 37 тыс.
50% 1

In this video I'll show you how to create rounded buttons with Kivy.
Rounded buttons are actually pretty easy to make with Kivy. We'll just use the Canvas and create a roundedrectangle that we define with the color and radius that we want.
It's pretty straight forward!

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@Codemycom
@Codemycom 3 года назад
▶️ Watch Entire Kivy Playlist ✅ Subscribe To My RU-vid Channel: bit.ly/37LrJ27 bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/3mhSbUG
@shivamconsultancyservices4449
@shivamconsultancyservices4449 3 года назад
How cool person. I have made several apps. You made me a programmer. Really your Ideas and Tricks makes us learn !
@vexinity5151
@vexinity5151 2 года назад
5:51 hi there, hope you are well can you please explain on how to make it change colour after being pressed. thank you.
@izzyanalytics4145
@izzyanalytics4145 3 года назад
This is a really cool feature. You can also make some really neat shaped buttons by adding radius dimensions for the other corners. for example --> radius: [0, 100, 0, 100]
@paulushimawan5196
@paulushimawan5196 2 года назад
cool
@hiwab41
@hiwab41 3 года назад
The best gui python channel😍
@Codemycom
@Codemycom 3 года назад
Thanks!
@cheaterman49
@cheaterman49 3 года назад
Good tutorial as always :-) while you're on the subject, it would be a great idea to cover the behaviors, and how to dynamically mix them in other widgets. In this specific case you are pretty much discarding the base Button canvas, so you should probably use and the same kvlang (minus background_* overrides). EDIT: And on the subject of discarding kvlang rules, you might wanna cover the override system at some point too :-)
@helloeveryone6614
@helloeveryone6614 3 месяца назад
Very helpful video , Can I change the colour of each RoundedButton ?
@helloeveryone6614
@helloeveryone6614 3 месяца назад
Rounded button not working without any error after writing code for rounded button in kv and saving it and running it is showing the same button ? Please reply
@ABSP5766
@ABSP5766 Год назад
At the end, is there a video explaining how to shade the button when pressed? If so, where? Thank you for this awesome tutorial.
@boblittle2529
@boblittle2529 2 месяца назад
It looks like your definition is a the bottom of the .kv file. I wasn't getting a rounded "GoodBye" button until I moved the definition to the top.
@bir52k1kv178
@bir52k1kv178 8 месяцев назад
rgba: button_color if self.state=='normal' else button_color_down
@guillermoguevara7171
@guillermoguevara7171 2 года назад
like and suscribed right away! thanks for the tutorial, your content is awersome
@mrinmoysarkar6936
@mrinmoysarkar6936 3 года назад
please make video on screenmanager
@rontarrant
@rontarrant Год назад
You said you went over how to make the button change visually when it's pressed in another video, but I've looked through the rest of the playlist and didn't see anything. Did you cover it, and if so, in which video? If not, could you, please? Great stuff, John. Learning lots. :)
@verenajens5308
@verenajens5308 3 года назад
Great video. I still stuck at putting pictures in the background of the buttons. Can you make a video about that?
@shivamconsultancyservices4449
@shivamconsultancyservices4449 3 года назад
You cannot add Pyimage as Button.
@nocopyrightgameplaystockvi231
@nocopyrightgameplaystockvi231 2 года назад
you have to use the background_color and set it to the link of the image in the project folder. I use it for animations of black and neon green, that makes the button appear to be clicked.
@user-lg2vh7ht7d
@user-lg2vh7ht7d 3 года назад
Nice video can u make a video how to display data from db on table?
@Codemycom
@Codemycom 3 года назад
Sure
@selimtanrverdi9639
@selimtanrverdi9639 3 года назад
As awesome as always.
@Codemycom
@Codemycom 3 года назад
Thanks!
@cwaidelich1
@cwaidelich1 3 года назад
Did you end up making another video on making the rounded buttons behavior change when pressed?
@Codemycom
@Codemycom 3 года назад
I think I have videos on that in the playlist.
@lauraskorczewski5813
@lauraskorczewski5813 3 года назад
Sir you are awesome.
@Codemycom
@Codemycom 3 года назад
:-p
@FelipeSalazarSch
@FelipeSalazarSch Год назад
Easy and clean, thx,.... The only thing it's when i tried to add a function on release, i can change the color but, the button goes back to rectangle shape :/
@Codemycom
@Codemycom Год назад
Welcome
@spectralcodec
@spectralcodec 3 года назад
Thanks man!
@dongilbreath1913
@dongilbreath1913 2 года назад
I'm working on a Raspberry Pi. All your other Kivy tutorials worked fine for me, but the button wouldn't round for me even though my design file looks identical to me with the same lines and indentation. I get no errors, just no rounding.
@dongilbreath1913
@dongilbreath1913 2 года назад
Okay never mind. Once I commented out the background_color and background_normal, it was rounded.
@StasonST19
@StasonST19 3 года назад
nice jobs!
@Codemycom
@Codemycom 3 года назад
Thanks!
@carcedopro7285
@carcedopro7285 2 года назад
do you have any idea how i can round a image? i tried the way you show in the video but its only add a rounded corners to image i want to make the image rounded not add rounded corners
@leroy7440
@leroy7440 2 года назад
Anyone know how to change the colour of the text inside the button
@botisonny
@botisonny 3 года назад
Perfect!
@Codemycom
@Codemycom 3 года назад
Thanks!
@ameermhmed3470
@ameermhmed3470 3 года назад
Thank you for your efforts .. Will it be in the workshops to learn KivyMD after this series to reach the completion of a complete application that deals with databases and the ability to benefit from it. Thanked
@Codemycom
@Codemycom 3 года назад
We'll see
@ameermhmed3470
@ameermhmed3470 3 года назад
@@Codemycom Thanked
@androov2797
@androov2797 3 года назад
How do i add a border to these buttons now?
@leosmi1
@leosmi1 3 года назад
when you inherited the button with roundedbutton, how the kivy lang undertod that it have to change the second button?
@problematicpunk
@problematicpunk 3 года назад
First he is using a BoxLayout which is vertical. This means the first Button is added and then the RoundedButton below it. Kivy adds widgets in the order of the kv file from top to bottom, so Button is added and then RoundedButton.
@anisrashidov235
@anisrashidov235 2 года назад
When I add another RoundedButton, everything suddenly stops working. Can anyone explain why? Can Layout have this effect?
@paulushimawan5196
@paulushimawan5196 2 года назад
It should work. It's impossible to know why without looking at the code
@rupamkarmakar8225
@rupamkarmakar8225 3 года назад
I am getting an error " TypeError: 'NoneType' object is not subscriptable". It will be very helpful if anyone can find the reason.
@problematicpunk
@problematicpunk 3 года назад
You'd have to be more specific. Maybe post your code, or even the entire error might be useful.
@charliecode
@charliecode 3 года назад
why can't we use roundedrectangle in .py file, does it's work only for kv language?
@problematicpunk
@problematicpunk 3 года назад
You can code it. Here is an example class. from kivy.uix.button import Button from kivy.graphics import RoundedRectangle, Color class RoundedButton(Button): def __init__(self, text): super(RoundedButton, self).__init__(text=text) self.background_normal = "atlas://data/images/defaulttheme/textinput" self.background_color = (0, 0, 0, 0) with self.canvas.before: Color(0, .467, .467, 1, mode='rgba') RoundedRectangle(size=self.size, pos=self.pos, radius=[20]) Then just added the widget to your App class.
@charliecode
@charliecode 3 года назад
@@problematicpunk yeah .. I did that but i didn't succeed to give to the rectangle the same position that the button.. I'll try it.. thanks
@problematicpunk
@problematicpunk 3 года назад
@@charliecode Yeah, lmk if it helps or if you have any questions. I tried it out, and the code above should work.
@videosincoming6850
@videosincoming6850 3 года назад
what does canvas.after do ?? 🤔🤔
@kavyajeetbora2585
@kavyajeetbora2585 2 года назад
it will put one canvas over the canvas.before
@mitchnyers3605
@mitchnyers3605 2 года назад
What IDE are you using here?
@Codemycom
@Codemycom 2 года назад
Sublime Text and the Git Bash Terminal
@jatingera924
@jatingera924 3 года назад
can this be done with Tkinter too ??
@Codemycom
@Codemycom 3 года назад
I have videos on how to make rounded buttons with tkinter on the tkinter playlist
@jatingera924
@jatingera924 3 года назад
@@Codemycom oh sorry, I did not check that. Thanks for concerning
Далее
Х.евая доставка 😂
00:23
Просмотров 801 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 397 тыс.
Hack your brain with Obsidian.md
11:53
Просмотров 1,9 млн
Modern Python logging
21:32
Просмотров 178 тыс.
Kivy Basics in 60 MINUTES
59:02
Просмотров 129 тыс.