Skip to content

Instantly share code, notes, and snippets.

@Mr-Coxall
Last active July 1, 2018 02:23
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/130d7270677add56b7b2fe793d51cbc1 to your computer and use it in GitHub Desktop.
Save Mr-Coxall/130d7270677add56b7b2fe793d51cbc1 to your computer and use it in GitHub Desktop.
hello_world_button.py
# Created by: Mr. Coxall
# Created on: Aug 2018
# 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('sheet')
[
{
"selected" : false,
"frame" : "{{0, 0}, {1024, 768}}",
"class" : "View",
"nodes" : [
{
"selected" : false,
"frame" : "{{437, 368}, {150, 32}}",
"class" : "Label",
"nodes" : [
],
"attributes" : {
"font_name" : "<System>",
"frame" : "{{437, 368}, {150, 32}}",
"uuid" : "8A876B0E-5CC8-4F08-BAC8-04DBA5BB4925",
"class" : "Label",
"alignment" : "center",
"text" : "",
"name" : "hello_world_label",
"font_size" : 18
}
},
{
"selected" : true,
"frame" : "{{472, 434}, {80, 32}}",
"class" : "Button",
"nodes" : [
],
"attributes" : {
"action" : "hello_world_touch_up_inside",
"frame" : "{{472, 368}, {80, 32}}",
"title" : "Click me!",
"uuid" : "E5A15431-FC7F-4FD9-AEB7-BEE537D343D2",
"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