-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Kivy Cookbook
By :

If we want to schedule the events, we can trigger them, which will help you trigger the same event in different parts of your code. In the next described recipe, the event will be triggered when we double tap.
Again, we are going to make use of the double tap, so it is important that you refer to the recipes in Chapter 2, Input, Motion, and Touch. Even though the skeleton of the code is similar to that for the last event, the actions are completely different. Here the unscheduling will be automatic.
Perform the following steps to achieve the goal:
First, in the KV file, declare an empty label using the following code:
<MyW>: Label: id: label1 pos: 200,200 text: ''
In the Python code, import the Clock
object instance.
In the widget class, define the method my_callback()
.
Also, define the method on_touch_down()
where we will define the trigger.
As shown in the following code, using an if
statement, select a double tap and...
Change the font size
Change margin width
Change background colour