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:
• North Peak Trail Hike At Red Rock Canyon
Watch video How To Create a Switch With Kivy - Python Kivy GUI Tutorial #39 online, duration hours minute second in high quality that is uploaded to the channel Codemy.com 15 February 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 13,997 times and liked it 332 visitors.