Следующий код прекрасно работает на Windows, но когда я пытаюсь запустить его на Kivy Launcher, он сразу падает.Есть файл kv и скрипт.Я пытался решить эту проблему в то же время, к сожалению, безуспешно.Спасибо за любую помощь.
скрипт Python
# -*- coding: utf-8 -*-
import kivy
kivy.require('1.1.3')
from kivy.app import App
#kivy.require("1.8.0")
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.widget import Widget
class Painter(Widget):
pass
class MainScreen(Screen):
pass
class AnotherScreen(Screen):
pass
class AnotherScreen2(Screen):
pass
class AnotherScreen3(Screen):
pass
class ScreenManagement(ScreenManager):
pass
presentation = Builder.load_file("showcase.kv")
class MainApp(App):
def build(self):
return presentation
if __name__ in ('__main__', '__android__'):
MainApp().run()
файл kv
Имя которого загружает скрипт Python: showcase.kv
#: import FadeTransition kivy.uix.screenmanager.FadeTransition
ScreenManagement:
transition: FadeTransition()
MainScreen:
AnotherScreen:
AnotherScreen2:
AnotherScreen3:
<MainScreen>:
name: "main"
FloatLayout:
Painter
Button:
text: "1"
on_release: app.root.current = "other"
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
pos_hint: {"right":1, "top":1}
Button:
text: "2"
on_release: app.root.current = "power"
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
pos_hint: {"x": 0, "top": 1}
Button:
text: "3"
on_release: app.root.current = "tube"
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
pos_hint: {"x": .5, "top": 1}
<AnotherScreen>:
name: "other"
FloatLayout:
Painter
Button:
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
text: "Back Home"
on_release: app.root.current = "main"
pos_hint: {"right":0.5, "top":1}
<AnotherScreen2>:
name: "power"
FloatLayout:
Painter
Button:
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
text: "Back Home"
on_release: app.root.current = "main"
pos_hint: {"right":0.5, "top":1}
<AnotherScreen3>:
name: "tube"
FloatLayout:
Painter
Button:
color: 0,1,0,1
font_size: 40
size_hint: 0.3,0.2
text: "Back Home"
on_release: app.root.current = "main"
pos_hint: {"right":0.5, "top":1}