Undefined
By: Guest | Date: Sep 18 2016 04:02 | Format: Python | Expires: never | Size: 1.6 KB | Hits: 748
- from kivy.app import App
- from kivy.core.window import Window
- from kivy.uix.screenmanager import ScreenManager, Screen, WipeTransition
- from kivy.properties import ObjectProperty
- from kivy.lang import Builder
- from kivy.properties import StringProperty
- from kivy.modules import inspector
- from kivy.uix.popup import Popup
- from kivy.uix.button import Button
- from kivy.uix.label import Label
- from kivy.uix.gridlayout import GridLayout
- class TitleScreen(Screen):
- pass
- class AddingGridLayout(GridLayout):
- def on_pre_enter(self):
- self.add_widget(Label(text="Here I is"))
- class Manager(ScreenManager):
- MainMenu_Screen = ObjectProperty(None)
- class ScreensApp(App):
- def build(self):
- m = Manager(transition=WipeTransition())
- m.current = 'TitleScreen'
- inspector.create_inspector(Window, m)
- return m
- if __name__ == "__main__":
- app = ScreensApp()
- app.run()
- ====================================
- <TitleScreen>:
- ScrollView:
- AddingGridLayout:
- cols: 1
- padding: 10
- spacing: 10
- size_hint_y: None
- do_scroll_x: True
- height: self.minimum_height
- Button:
- text: 'Refresh'
- size_hint_x: .1
- size_hint_y: .1
- on_press: root.manager.current = 'TitleScreen'
- size_hint_y: None
- <Manager>:
- id: screen_manager
- title_screen: title_screen
- TitleScreen:
- id: title_screen
- name: 'TitleScreen'
- manager: screen_manager
Latest pastes
1 days ago
1 days ago
2 days ago
4 days ago
5 days ago