Kivy and its properties

Even though we have only touched upon explanations of properties in the previous section, the truth is that we have been using them since the beginning of this chapter. Kivy's internals are full of properties. They are almost everywhere. For example, when we implemented DraggableWidget, we simply modified the center_x property (line 72 and 73), and the whole Widget was then kept updated because there is a chain of properties involved in the use of center_x.

The last example in this chapter illustrates how powerful Kivy properties are. Here is the code for statusbar.py:

273. # File name: statusbar.py 274. from kivy.uix.boxlayout import BoxLayout 275. from kivy.properties import NumericProperty, ObjectProperty 276. 277. class ...

Get Kivy – Interactive Applications and Games in Python - Second Edition 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.