Skip to content

Instantly share code, notes, and snippets.

@feoh
Last active December 18, 2016 15:38
Show Gist options
  • Save feoh/a01b8f33d1fecb078fd3e8f9888ede3f to your computer and use it in GitHub Desktop.
Save feoh/a01b8f33d1fecb078fd3e8f9888ede3f to your computer and use it in GitHub Desktop.
My first attempt at a Toga app
import toga
def build(app):
"""Blah"""
def button_handler(widget):
"""Blah """
entries.insert(None, entry.value)
box = toga.Box()
entries = toga.Table(["Entries"])
entry = toga.TextInput()
button = toga.Button('Add Entry', on_press=button_handler)
button.style.set(margin=50)
box.add(entries)
box.add(entry)
box.add(button)
return box
if __name__ == '__main__':
app = toga.App('First App', 'org.pybee.qual', startup=build)
app.main_loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment