test-kivy-app/kivy_venv/share/kivy-examples/widgets/lang_dynamic_classes.py
2024-09-15 15:12:16 +03:00

19 lines
328 B
Python

# Dynamic kv classes
from kivy.lang import Builder
from kivy.base import runTouchApp
root = Builder.load_string('''
<ImageButton@Button>:
source: None
Image:
source: root.source
center: root.center
ImageButton:
source: 'kivy/data/logo/kivy-icon-512.png'
''')
runTouchApp(root)