Created
April 28, 2015 05:25
-
-
Save Geogouz/f48fee23e5507faad440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################## | |
# Python for kivy A1 and A2 | |
############################################## | |
from kivy.app import App | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.screenmanager import ScreenManager, Screen | |
class SecondScreen(Screen): | |
pass | |
class FirstScreen(Screen): | |
pass | |
class MyScreenManager(ScreenManager): | |
pass | |
class MainFrame(BoxLayout): | |
pass | |
class myApp(App): | |
def build(self): | |
return MainFrame() | |
myApp().run() | |
############################################## | |
# kivy A1 | |
############################################## | |
<MainFrame> | |
Button: | |
text: 'next' | |
on_release: manager.current = manager.next() | |
MyScreenManager: | |
id: manager | |
FirstScreen: | |
name: 'first' | |
BoxLayout: | |
Label: | |
text: 'first screen!' | |
SecondScreen: | |
name: 'second' | |
BoxLayout: | |
Label: | |
text: 'second screen!' | |
############################################## | |
# kivy A2 | |
############################################## | |
<MainFrame> | |
Button: | |
text: 'next' | |
on_release: manager.current = manager.next() | |
MyScreenManager: | |
<MyScreenManager>: | |
id: manager | |
FirstScreen: | |
SecondScreen: | |
<FirstScreen>: | |
name: 'first' | |
BoxLayout: | |
Label: | |
text: 'first screen!' | |
<SecondScreen>: | |
name: 'second' | |
BoxLayout: | |
Label: | |
text: 'second screen!' | |
############################################## | |
# Python for kivy B1 | |
############################################## | |
from kivy.app import App | |
from kivy.uix.boxlayout import BoxLayout | |
class MainFrame(BoxLayout): | |
pass | |
class MyApp(App): | |
def build(self): | |
return MainFrame() | |
MyApp().run() | |
############################################## | |
# kivy B1 | |
############################################## | |
<MainFrame> | |
Button: | |
text: 'next' | |
on_release: manager.current = manager.next() | |
ScreenManager: | |
id: manager | |
Screen: | |
name: 'first' | |
BoxLayout: | |
Label: | |
text: 'first screen!' | |
Screen: | |
name: 'second' | |
BoxLayout: | |
Label: | |
text: 'second screen!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment