def run(self, startPoint = None): self.startPoint = startPoint self.regist(startPoint) # start method if hasattr(startPoint, "start"): self.startAppList.append(startPoint) App.run(self)
def voltar(): janela = App() Window.clearcolor = [0, 0, 0, 0] Window.size = 800, 600 janela.title, janela.build = 'Contabilidade Cabral', build janela2.stop() janela.run()
def test_kivy(self): try: from async_gui.toolkits.kivy import KivyEngine from kivy.app import App from kivy.clock import Clock except ImportError: return self.skipTest("Kivy not installed") called = [False] root = App() Clock.schedule_once(lambda e: self._check_toolkit( KivyEngine, root, root.stop, called)) root.run() self.assertTrue(called[0])
def test_start_raw_app(self): lang._delayed_start = None a = App() Clock.schedule_once(a.stop, .1) a.run()
self.add_widget(self._text_box) layout = BoxLayout(orientation="vertical", size_hint=(.5, 1)) layout.add_widget(self._up_button) layout.add_widget(self._down_button) self.add_widget(layout) def on_value(self, instance, value): if value < self.minimum: self.value = self.minimum elif value > self.maximum: self.value = self.maximum else: self._text_box.text = str(value) def _from_text(self, *args): self.value = int(self._text_box.text) def _increment(self, *args): self.value += 1 def _decrement(self, *args): self.value -= 1 if __name__ == '__main__': from kivy.app import App app = App() app.root = SpinBox(minimum=-10, maximum=10) app.run()
def test_start_raw_app(self): a = App() Clock.schedule_once(a.stop, .1) a.run()
def run(self, *args, **kwargs): App.run(self, *args, **kwargs)
def run(self, startPoint = None): self.startPoint = startPoint self.regist(startPoint) App.run(self)
ed = TextInput(text="teste") ed =ed.global ed.size_hint = None, None ed.height = 300 ed.width = 400 ed.y = 250 ed.x = 90 btn = Button(text="Clique aqui") btn.size_hint = None, None btn.width = 200 btn.height = 50 btn.y = 150 btn.x = 200 btn.on_press= click() layout.add_widget(ed) layout.add_widget(btn) return layout #antes de posicionar um componente deve se dizer as dimensões dele wind = App() from kivy.core.window import Window wind.title="Testes" Window.size = 600, 600 wind.build = build wind.run()
#encoding :utf-8 from kivy.app import App from kivy.uix.label import Label def build(): return Label(text ="Hello World") hw=App()#diz que o nome da instancia é o hw hw.build = build #associa o hw a função build mas sem executa-la para que ela só seja executada dentro do aplicativo quando o quesito for atendido com por exemplo chamar a tela hw.run()#executa o codigo #App().run()# faz a tela abrir e executa ela em geral abre apenas uma tela preta que contem as funções do sistema em execução