Book Image

Kivy Blueprints

Book Image

Kivy Blueprints

Overview of this book

Table of Contents (17 chapters)
Kivy Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Python Ecosystem
Index

Setting the stage


Initially, the entire surface of our app is occupied by the root widget, in this case, that's the canvas the user can paint upon. We won't devote any screen space to the instruments' area until later.

As you probably know by now, the root widget is the outermost widget in the hierarchy. Every Kivy application has one, and it can be pretty much anything, depending on the desired behavior. As seen in Chapter 1, Building a Clock App, BoxLayout is a suitable root widget; it was sufficient as we had no additional requirements for it, and layouts are designed to work as containers for other controls.

In the case of a Paint app, we need its root widget to adhere to much more interesting requirements; the user should be able to draw lines, possibly utilizing multitouch functionality, if available. At the moment, Kivy has no built-in controls suitable for the task at hand, so we will need to create our own.

Building new Kivy widgets is simple. As soon as our class inherits from Kivy...