Created
January 23, 2015 02:33
-
-
Save inclement/17614c3d11e5004d5200 to your computer and use it in GitHub Desktop.
Example kivy app with two panes
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.boxlayout import BoxLayout | |
| from kivy.lang import Builder | |
| Builder.load_string(''' | |
| <MainWidget>: | |
| BoxLayout: | |
| orientation: 'vertical' | |
| Button: | |
| text: 'some string ' | |
| on_press: the_right_pane.text += self.text | |
| Button: | |
| text: 'one two three four ' | |
| on_press: the_right_pane.text += self.text | |
| Button: | |
| text: 'follow the yellow brick road ' | |
| on_press: the_right_pane.text += self.text | |
| Button: | |
| text: 'five six seven eight ' | |
| on_press: the_right_pane.text += self.text | |
| Button: | |
| text: 'CLEAR LABEL' | |
| on_press: the_right_pane.text = '' | |
| Label: | |
| id: the_right_pane | |
| text: '' | |
| text_size: self.size | |
| halign: 'center' | |
| valign: 'middle' | |
| ''') | |
| class MainWidget(BoxLayout): | |
| pass | |
| class ExampleApp(App): | |
| def build(self): | |
| return MainWidget() | |
| ExampleApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment