Skip to content

Instantly share code, notes, and snippets.

@GiuseppeChillemi
Created October 29, 2024 20:55
Show Gist options
  • Save GiuseppeChillemi/b6a232a383ff70776f0cb80f23765d58 to your computer and use it in GitHub Desktop.
Save GiuseppeChillemi/b6a232a383ff70776f0cb80f23765d58 to your computer and use it in GitHub Desktop.
Composable library
Red [
Title: "VID Composablel library test"
]
library: [
p1 [
code-segment [
panel 600x40 [
b: button "Hit me!" [
insert clear head t/text "Hit me but not so strong!!!"
]
t: Text "" 250x15 with [text: copy panel-text]
]
]
ctxs [[pa: b: t: none panel-text: "xx"]]
]
p2 [
code-segment [
pa: panel 600x200 [
b: Button "Change text" [t/text: "UPPERCASE"]
t: h3 "This is a banner!" 250x60
return
b2: Button "Change P1" [
code-to-be-written-to-set-p1
t2: text "p2" 250x15 with [text: copy panel-text]
]
]
]
ctxs [[pa: b: t: b2: t2: none panel-text: ""]]
]
p3 [
code-segment [
pa: (compose bind copy/deep library/p1/code-segment context library/p1/ctxs/1)
return
pb: (compose bind copy/deep library/p1/code-segment context library/p1/ctxs/1)
return
(compose bind copy/deep library/p2/code-segment context library/p2/ctxs/1)
]
ctxs [[pa: pb: none]]
]
]
view probe gui: compose/deep bind [
p: panel 600x300 [(compose bind copy/deep library/p3/code-segment context library/p3/ctxs/1)]
] make object! [p: none]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment