Kivy Properties¶
Using Kivy’s Properties
Kivy properties are an implementation of the observer pattern . Kivy’s properties are useful to:
- Allow manipulating your widgets in kv language more easily
- Automatically observe any changes and dispatch functions/code accordingly
- Value checking/validation
- Optimize memory managment
To use them, you have to declare them at class level. That is, directly in the class, not în any method of the class, the property is a class attribute that will automatically create instance attributes. Each property by default provides a on_property event that is called whenever the properties state/value changes .
- Kivy provides the following properties:
- NumericProperty, StringProperty, ListProperty, ObjectProperty, BooleanProperty, BoundedNumericProperty, OptionProperty, ReferenceListProperty, AliasProperty, DictProperty,
For a in-depth look in how-to use kivy properties start here