Last active
August 29, 2015 14:04
-
-
Save jbking/9cc65065d8cb862d66d9 to your computer and use it in GitHub Desktop.
Counter
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
# coding: utf-8 | |
import ui | |
v = ui.load_view('Untitled') | |
i = 0 | |
lbl = v['label1'] | |
def btn_action(sender): | |
global i | |
i += 1 | |
lbl.text = str(i) | |
btn = v['button1'] | |
btn.action = btn_action | |
if ui.get_screen_size()[1] >= 768: | |
# iPad | |
v.present('popover') | |
else: | |
# iPhone | |
v.present(orientations=['portrait']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment