Created
December 14, 2011 21:29
-
-
Save tshirtman/1478634 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#:kivy 1.0 | |
#:import SomeWidget main.SomeWidget | |
# rules for the widget | |
<SomeWidget>: | |
BoxLayout: | |
pos: root.pos | |
size: root.size | |
orientation: "vertical" | |
Label: | |
text: "hello" | |
Button: | |
text: "world" | |
# root | |
BoxLayout: | |
id: layout | |
Button: | |
text: "add" | |
on_press: layout.add_widget(SomeWidget()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.factory import Factory | |
class SomeWidget(Widget): | |
pass | |
Factory.register('SomeWidget', SomeWidget) | |
class Main(App): | |
pass | |
Main().run() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment