Skip to content

Instantly share code, notes, and snippets.

@greggirwin
Created March 9, 2018 07:23
Show Gist options
  • Save greggirwin/e40459503f75a748b056d08b3f8289ea to your computer and use it in GitHub Desktop.
Save greggirwin/e40459503f75a748b056d08b3f8289ea to your computer and use it in GitHub Desktop.
Show how to drop loose faces and generate a layout from them.
Red [
Purpose: "Show how to drop faces to make a GUI and save it."
]
spec: copy []
btn-pos: 700x10
n: 0
view/options [
size 800x600
at btn-pos
btn: button "Button" loose on-drop [
n: n + 1
name: append copy "Button " n
p: face/offset
repend spec ['at p 'button name []]
repend face/parent/draw ['box p p + face/size 'text p + 4x5 name]
new-line find/last spec 'at on
print mold spec
btn/offset: btn-pos
]
][draw: []]
view spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment