Back to Browse

How To Create a Switch With Kivy - Python Kivy GUI Tutorial #39

14.9K views
Feb 15, 2021
9:39

In this video I'll show you how to easily add a switch to your Kivy App. Switches are great for toggling things on or off. To create a switch, just define it in your .kv file and set an on_active function that we can define on the python backend. The switch will pass a switchValue when clicked that is either True or False. Then we can run a simple if statement to determine whether the switch has been switched to on or off, and take action accordingly. Timecodes 0:00​ - Introduction 0:40 - Birthday Announcement and Hiking Channel 2:35 - Add A Label To Our App 2:58 - Add Switch to .kv Code 4:01 - Add Switch_Click Function to .py File 5:42 - Determine If Switch Is On Or Off And Update Label 6:53 - Set Switch To "Off" By Default 7:24 - Disable Switch By Default 7:59 - Disable Switch Programatically 9:12 - Conclusion And Check out my North Peak Hiking Video: https://www.youtube.com/watch?v=swgK8aChMx4

Download

0 formats

No download links available.

How To Create a Switch With Kivy - Python Kivy GUI Tutorial #39 | NatokHD