O'Reilly logo

Kivy – Interactive Applications and Games in Python - Second Edition by Roberto Ulloa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding events in the Kivy language

So far, we have been handling events in two ways: overridding an event method (for example, on_touch_event) and binding a personalize method to a related event method (for example, ds.bind(on_touch_move=self.update_figure)). In this section, we will discuss a different way, that is, binding events in the Kivy language. Potentially, we could have done this since the beginning of this chapter when we started working with DraggableWidget but there is a difference. If we use the Kivy language, we can easily add the event to a specific instance and not to all the instances of the same class. In this sense, it resembles dinamically binding an instance to its callback with the bind method.

We are going to concentrate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required