From 3d3a6d0872c3ef2042afce4753209d5f3a0594c1 Mon Sep 17 00:00:00 2001 From: dessant Date: Fri, 15 May 2015 10:23:30 +0300 Subject: [PATCH] move kivy.require before other imports and convert tabs to space-tabs in kv example --- examples/kv/ids/id_in_kv/id_in_kv.py | 9 +++++---- examples/kv/ids/id_in_kv/test.kv | 16 ++++++++-------- examples/kv/ids/kv_and_py/kv_and_py.py | 11 ++++++----- examples/kv/ids/kv_and_py/test.kv | 19 +++++++++---------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/examples/kv/ids/id_in_kv/id_in_kv.py b/examples/kv/ids/id_in_kv/id_in_kv.py index c18c33446..9a6679353 100644 --- a/examples/kv/ids/id_in_kv/id_in_kv.py +++ b/examples/kv/ids/id_in_kv/id_in_kv.py @@ -1,15 +1,16 @@ ''' -The use of id in .kv -================================== +The use of id in KV +=================== This small example shows how to refer from one widget -on an other widget within .kv +to another within KV. ''' -from kivy.app import App import kivy kivy.require('1.8.0') +from kivy.app import App + class TestApp(App): pass diff --git a/examples/kv/ids/id_in_kv/test.kv b/examples/kv/ids/id_in_kv/test.kv index 32500dd45..ef6a14bcb 100644 --- a/examples/kv/ids/id_in_kv/test.kv +++ b/examples/kv/ids/id_in_kv/test.kv @@ -1,11 +1,11 @@ #:kivy 1.8.0 BoxLayout: - orientation: 'vertical' - TextInput: - # setting the id of the widget - id: my_id - text: 'The text of the label is set within kivy' - Label: - # showing the text of the textinput by referring on the id - text: my_id.text + orientation: 'vertical' + TextInput: + # setting the id of the widget + id: my_id + text: 'The text of the label is set within kivy' + Label: + # showing the text of the textinput by referring on the id + text: my_id.text diff --git a/examples/kv/ids/kv_and_py/kv_and_py.py b/examples/kv/ids/kv_and_py/kv_and_py.py index 44dfbde02..927ceadde 100644 --- a/examples/kv/ids/kv_and_py/kv_and_py.py +++ b/examples/kv/ids/kv_and_py/kv_and_py.py @@ -1,15 +1,16 @@ ''' - Referring on ids from .py -================================== +Referring on ids from Python +============================= -This example shows how to refer to an id from a .py file. +This example shows how to refer to an id from a Python file. ''' -from kivy.app import App -from kivy.uix.boxlayout import BoxLayout import kivy kivy.require('1.8.0') +from kivy.app import App +from kivy.uix.boxlayout import BoxLayout + class RootWidget(BoxLayout): diff --git a/examples/kv/ids/kv_and_py/test.kv b/examples/kv/ids/kv_and_py/test.kv index 8a9ef9595..a18291697 100644 --- a/examples/kv/ids/kv_and_py/test.kv +++ b/examples/kv/ids/kv_and_py/test.kv @@ -1,12 +1,11 @@ -#:kivy 1.0 +#:kivy 1.8.0 RootWidget: - BoxLayout: - orientation: 'vertical' - Switch: - id: my_switch - on_active: root.first_function(self.active) - - Label: - id: my_label - text: 'This text will be changed by the python file' + BoxLayout: + orientation: 'vertical' + Switch: + id: my_switch + on_active: root.first_function(self.active) + Label: + id: my_label + text: 'This text will be changed by the python file'