Created
June 15, 2013 04:18
-
-
Save Kovak/5786878 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from kivy.app import App | |
| from kivy.uix.widget import Widget | |
| from kivy.uix.label import Label | |
| class RootWidget(Widget): | |
| pass | |
| class Robot(Widget): | |
| def on_pos(self, instance, value): | |
| print 'robot_pos: ', value | |
| class CustomLabel(Label): | |
| def on_pos(self, instance, value): | |
| print 'label_pos: ', value | |
| class TestApp(App): | |
| def build(self): | |
| pass | |
| if __name__ == '__main__': | |
| TestApp().run() |
This file contains hidden or 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
| RootWidget: | |
| <RootWidget>: | |
| Robot: | |
| <Robot>: | |
| pos: (250,250) | |
| size: (40,40) | |
| label_robot: robot_label | |
| canvas: | |
| Color: | |
| rgb: (1,0,0) | |
| Rectangle: | |
| size: self.size | |
| pos: self.pos | |
| on_pos: | |
| print self.pos | |
| CustomLabel: | |
| id: robot_label | |
| font_size: 25 | |
| text: "B" | |
| color: (0, 1, 0, 1) | |
| pos: root.pos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment