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:

  1. Import the kivy package.
  2. Import the App package.
  3. Import the Widget package.
  4. Define the MyW() class.
  5. Define the e1App() class instanced as App.
  6. Define the build() method and give an icon and a title to the app.
  7. 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.