Created
August 28, 2015 16:43
-
-
Save kived/a1308fd4ca203881e914 to your computer and use it in GitHub Desktop.
Kivy: pause after on_press
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.9.0') | |
from kivy.app import App | |
from kivy.lang import Builder | |
import webbrowser | |
root = Builder.load_string(''' | |
Button: | |
text: 'Press Me!' | |
on_press: app.doit() | |
on_release: print 'BUTTON RELEASED' | |
''') | |
class TestApp(App): | |
def build(self): | |
return root | |
def on_pause(self): | |
print 'PAUSING APP NOW!!!!' | |
return True | |
def on_resume(self): | |
print 'RESUMING APP NOW!!!!' | |
def doit(self, *args): | |
webbrowser.open('http://kivy.org') | |
if __name__ == '__main__': | |
TestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment