From df853271c35f58f210da3110a3f921db1b1d890f Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Fri, 23 Jan 2015 22:44:45 +0000 Subject: [PATCH] Added miscellaneous examples folder + first entry --- examples/miscellaneous/two_panes.py | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 examples/miscellaneous/two_panes.py diff --git a/examples/miscellaneous/two_panes.py b/examples/miscellaneous/two_panes.py new file mode 100644 index 000000000..c773947b8 --- /dev/null +++ b/examples/miscellaneous/two_panes.py @@ -0,0 +1,47 @@ +'' +'Demonstrates using kv language to create some simple buttons and a +label, with each button modifying the label text. +''' + +from kivy.app import App +from kivy.uix.boxlayout import BoxLayout +from kivy.lang import Builder + +Builder.load_string(''' +: + 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() +