Getting to know the API
Our starting point is going to be the App
class, which is the base to create Kivy applications. In this recipe, we are going to create a simple app that uses some resources from this class.
Getting ready
Please go through the Building your Interfaces recipe from Chapter 1, Kivy and the Kv Language, which is important and will help you see the role of the App
class in the code.
How to do it…
To complete this recipe, we will create a Python file to make the resources present in the App
class. Let's follow these steps:
- Import the
kivy
package. - Import the
App
package. - Import the
Widget
package. - Define the
MyW()
class. - Define the
e1App()
class instanced asApp
. - Define the
build()
method and give an icon and a title to the app. - Define the ...
Get Kivy Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.