Using the basics: buttons, labels, and text inputs

Here, we will work with basic widgets as the first approach to the chapter topic. In our task, we will develop an app that has three elements: a text input, a button, and a label. Using this, the user can modify the label by pressing the button, by moving the cursor into the text input, or by changing the text input.

Getting ready

In the following few recipes, we are going to intensively use Kv language, so it is important for you to read Chapter 1, Kivy and the Kv language or at least the recipe Accessing widgets defined inside Kv language in your Python code from the first chapter.

How to do it…

To complete the task, follow these steps:

  1. In the KV file, define a label.
  2. Also define the button with an ...

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.