Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Screen1(Screen):
- pass
- class Screen2(Screen):
- pass
- class MyManager(ScreenManager):
- pass
- class PopUp(Popup):
- def changeText(self,nameStr):
- self.ids.label.text = "You are on Screen %s!" %nameStr #this is text that I want to display
- class PrimaryApp(App):
- def build(self):
- return MyManager()
- PrimaryApp().run()
- #:import Factory kivy.factory.Factory
- <MyManager>:
- Screen1:
- id: screen1
- Screen2:
- id: screen2
- <Screen1>:
- name: "one"
- GridLayout:
- id: grid
- rows: 2
- Button:
- id: button1
- text: "Go to Screen Two"
- on_release: root.manager.current = "two"
- Button:
- id: button2
- text: "Display Popup"
- on_release:
- Factory.PopUp().changeText(root.name)
- Factory.PopUp().open()
- <Screen2>:
- name: "two"
- GridLayout:
- id: grid
- rows: 2
- Button:
- id: button1
- text: "Go to Screen One"
- on_release: root.manager.current = "one"
- Button:
- id: button2
- text: "Display Popup"
- on_release:
- Factory.PopUp().changeText(root.name)
- Factory.PopUp().open()
- <PopUp>:
- id:pop
- size_hint: (.5,.5)
- title: "Notice!"
- Label:
- id: label
- text: "PLACEHOLDER TEXT" #this is not the code I want displayed
Add Comment
Please, Sign In to add comment