test-kivy-app/kivy_venv/share/kivy-examples/widgets/lang_dynamic_classes.py

19 lines
328 B
Python
Raw Normal View History

2024-09-15 12:12:16 +00:00
# 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)