Declaring a property

This recipe will work with the last type of events, which is the property event. To be very specific, we will create an invisible widget that will fire an event when a selected property is changed. Just to identify of this invisible widget, we surround it with two normal buttons; thus, the section between them is our invisible widget.

Getting ready

The properties in Kivy have been reviewed in Chapter 1, Kivy and the Kv language, specifically with in the Declaring properties within a class recipe. Thus, it will be useful to refer to this recipe and also to the section on multitouching from Chapter 2, Input, Motion, and Touch.

How to do it…

The recipe is:

  1. First, import the ListProperty from Kivy properties.
  2. Create the class for 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.