Skip to content

Instantly share code, notes, and snippets.

@kived
Created February 19, 2016 20:43
Show Gist options
  • Save kived/92789083f501921ed887 to your computer and use it in GitHub Desktop.
Save kived/92789083f501921ed887 to your computer and use it in GitHub Desktop.
Kivy: small ModalView
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
root = Builder.load_string('''
<MyModalView@ModalView>:
size_hint: 0.5, 0.5
Button:
text: 'close'
on_release: root.dismiss()
Button:
text: 'open'
on_release: app.open_modal()
''')
class TestApp(App):
def build(self):
return root
def open_modal(self):
Factory.MyModalView().open()
if __name__ == '__main__':
TestApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment