Skip to content

Instantly share code, notes, and snippets.

@matham
Last active August 24, 2018 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matham/45c4f1fbd8c3fccf6557b3b48356cd50 to your computer and use it in GitHub Desktop.
Save matham/45c4f1fbd8c3fccf6557b3b48356cd50 to your computer and use it in GitHub Desktop.
gui
from kivy.lang import Builder
from kivy.app import runTouchApp
runTouchApp(Builder.load_string('''
#:import Factory kivy.factory.Factory
BoxLayout:
orientation: 'vertical'
padding: "12dp"
spacing: "12dp"
Label:
text: "Please enter 3 numbers"
BoxLayout:
spacing: "10dp"
Entry:
id: a
hint_text: "A"
Entry:
id: b
hint_text: "B"
Entry:
id: c
hint_text: "C"
Label:
text: "The sum is {}".format(a.val + b.val + c.val)
<Entry@TextInput>:
input_filter: "float"
val: float(self.text) if self.text else 0
'''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment