From 9b21638be38fba95d031c4a879a79d17b02a987d Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 18 Jun 2012 02:48:44 +0200 Subject: [PATCH] fixes app build with kv usage/root widget + others typo --- examples/RST_Editor/editor.kv | 12 ++++++------ examples/RST_Editor/main.py | 4 ++-- kivy/app.py | 6 ++++-- kivy/interactive.py | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/RST_Editor/editor.kv b/examples/RST_Editor/editor.kv index a7ff43bfa..feeaa5c55 100644 --- a/examples/RST_Editor/editor.kv +++ b/examples/RST_Editor/editor.kv @@ -9,10 +9,10 @@ Root: size_hint_y: None height: 30 Button: - text: 'load' + text: 'Load' on_release: root.show_load() Button: - text: 'save' + text: 'Save' on_release: root.show_save() BoxLayout: @@ -36,11 +36,11 @@ Root: size_hint_y: None height: 30 Button: - text: "cancel" + text: "Cancel" on_release: root.cancel() Button: - text: "load" + text: "Load" on_release: root.load(filechooser.path, filechooser.selection) : @@ -63,10 +63,10 @@ Root: size_hint_y: None height: 30 Button: - text: "cancel" + text: "Cancel" on_release: root.cancel() Button: - text: "save" + text: "Save" on_release: root.save(filechooser.path, text_input.text) diff --git a/examples/RST_Editor/main.py b/examples/RST_Editor/main.py index 27d98eac1..aa5f59bbd 100644 --- a/examples/RST_Editor/main.py +++ b/examples/RST_Editor/main.py @@ -28,12 +28,12 @@ class Root(FloatLayout): def show_load(self): content = LoadDialog(load=self.load, cancel=self.dismiss_popup) - self._popup = Popup(title="load file", content=content, size_hint=(0.9, 0.9)) + self._popup = Popup(title="Load file", content=content, size_hint=(0.9, 0.9)) self._popup.open() def show_save(self): content = SaveDialog(save=self.save, cancel=self.dismiss_popup) - self._popup = Popup(title="save file", content=content, size_hint=(0.9, 0.9)) + self._popup = Popup(title="Save file", content=content, size_hint=(0.9, 0.9)) self._popup.open() def load(self, path, filename): diff --git a/kivy/app.py b/kivy/app.py index ba07b1f21..d1eb406f6 100644 --- a/kivy/app.py +++ b/kivy/app.py @@ -299,9 +299,11 @@ class App(EventDispatcher): If this method returns a widget (tree), it will be used as the root widget and added to the window. - :return: None or a root :class:`~kivy.uix.widget.Widget` instance + :return: None or a root :class:`~kivy.uix.widget.Widget` instance is no + self.root exist. ''' - return Widget() + if not self.root: + return Widget() def build_config(self, config): '''.. versionadded:: 1.0.7 diff --git a/kivy/interactive.py b/kivy/interactive.py index d74ee7d21..23003bfbd 100644 --- a/kivy/interactive.py +++ b/kivy/interactive.py @@ -1,6 +1,6 @@ ''' -InteractiveLauncher -=================== +Interactive launcher +==================== .. versionadded:: 1.3.0