Created
February 19, 2016 20:43
-
-
Save kived/92789083f501921ed887 to your computer and use it in GitHub Desktop.
Kivy: small ModalView
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
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