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 and unbinding events – sizing limbs and heads

In the previous two sections, we override basic events to perform actions we want. In this section, you will learn how to bind and unbind events dynamically. It was quite an easy job to add our Stickman because it is a Widget already, but what about the graphics, the circle, and the rectangle? We could create some widgets for them, just as we did with the Stickman, but let's attempt something braver before that. Instead of just clicking on the drawing space, let's drag the mouse on its border to decide the size of the circle or line:

Binding and unbinding events – sizing limbs and heads

Using mouse to set the size

Once we finish the dragging (and ...

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