Skip to content

Instantly share code, notes, and snippets.

@Mr-Coxall
Created September 14, 2016 17:57
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 Mr-Coxall/0929deef886b207cecf00acc01cc04aa to your computer and use it in GitHub Desktop.
Save Mr-Coxall/0929deef886b207cecf00acc01cc04aa to your computer and use it in GitHub Desktop.
hello_world_with_button.py
# Created by: Mr. Coxall
# Created on: Aug 2016
# Created for: ICS3U
# This program is the Hello, World! program, but with a button
import ui
def hello_world_touch_up_inside(sender):
#print ('Hello, World!')
view['hello_world_label'].text = ("Hello, World!")
view = ui.load_view()
view.present('full_screen')
[
{
"selected" : false,
"frame" : "{{0, 0}, {1024, 768}}",
"class" : "View",
"nodes" : [
{
"selected" : false,
"frame" : "{{432, 469}, {150, 32}}",
"class" : "Label",
"nodes" : [
],
"attributes" : {
"font_name" : "<System>",
"frame" : "{{437, 368}, {150, 32}}",
"uuid" : "4B1F347B-B6C1-4A73-AC2A-97234DBB9E91",
"class" : "Label",
"alignment" : "left",
"text" : "",
"name" : "hello_world_label",
"font_size" : 18
}
},
{
"selected" : true,
"frame" : "{{472, 368}, {80, 32}}",
"class" : "Button",
"nodes" : [
],
"attributes" : {
"action" : "hello_world_touch_up_inside",
"frame" : "{{472, 368}, {80, 32}}",
"title" : "Click me!",
"uuid" : "AD1B9F41-2A43-4D1B-8B03-43A3B916DC94",
"class" : "Button",
"name" : "hello_world_button",
"font_size" : 15
}
}
],
"attributes" : {
"enabled" : true,
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
"flex" : ""
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment