-
Book Overview & Buying
-
Table Of Contents
Kivy Cookbook
By :
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.
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.
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 as App.
Define the build() method and give an icon and a title to the app.
Define the on_start() method.
Define the on_pause() method.
Define the on_resume() method.
Define the on_stop() method.
End the app with the usual lines:
import kivy
from kivy.app import App
from kivy.uix.widget import Widget
class MyW(Widget):
pass
class...
Change the font size
Change margin width
Change background colour