How dynamic can we be?
[1/8] from: g:santilli:tiscalinet:it at: 23-Nov-2002 22:55
Hello all,
view lay: layout code: [Do [trebuchet: [name: "Trebuchet MS" size: 14]]
Style Button Btn font trebuchet font-size 16 bold -1x28
Banner center 600 font trebuchet font-size 38 bold yellow "The REBOL evolving GUI"
Text right 600 font trebuchet font-size 16 "by Gabriele Santilli"
Pad -10 Text right 600 font trebuchet italic "(original idea by Baron R.K. Von Wolfsheild)"
Text 600 font trebuchet
{Maybe I'm just crazy, but this is so much fun! It is amazing to see how easy I can be
amazed by these short things... I wonder if any other language could do this in so few
lines of code, and with this readability...}
Across
Text font trebuchet right 50 "Title:"
Pad -8 tit: Field either value? 'window-title [window-title] ["Evolving GUI"] 550 font
trebuchet Return
a: Area font trebuchet 583x300 (mold/only code)
Pad -8 Scroller 17x300 [
tsize: size-text a
a/para/scroll/y: 280 - tsize/y * face/data
show a
]
Return
Button "Update" 255.200.50 [
attempt [
window-title: tit/text
lay2: layout code: any [attempt [load a/text] code]
lay/pane: lay2/pane
lay/size: lay2/size
show lay
lay/text: window-title
lay/changes: 'text
show lay
]
]
Button "Copy" 50.240.100 [
write clipboard:// join "view lay: layout code: " mold code
]
]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[2/8] from: al:bri:xtra at: 24-Nov-2002 13:40
> {Maybe I'm just crazy, but this is so much fun! It is amazing to see
how easy I can be amazed by these short things... I wonder if any other
language could do this in so few lines of code, and with this
readability...}
Very nice and cute, Gabriele!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[3/8] from: g:santilli:tiscalinet:it at: 24-Nov-2002 2:22
Hi Gregg,
On Sunday, November 24, 2002, 12:17:30 AM, you wrote:
GI> That's very impressive indeed!
A few minutes after that post, it was already more evolved. I
couldn't stop playing with it. :-)
view lay: layout code: [
Do [trebuchet: [name: "Trebuchet MS" size: 14]]
Style Button Btn font trebuchet font-size 16 bold -1x28
Banner center 600 font trebuchet font-size 38 bold yellow "The REBOL evolving GUI"
Text right 600 font trebuchet font-size 16 "by Gabriele Santilli"
Pad -10 Text right 600 font trebuchet italic "(original idea by Baron R.K. Von Wolfsheild)"
Text 600 font trebuchet
{Maybe I'm just crazy, but this is so much fun! It is amazing to see how easy I can be
amazed by these short things... I wonder if any other language could do this in so few
lines of code, and with this readability...}
Across
Text font trebuchet right 50 "Title:"
Pad -8 tit: Field either value? 'window-title [window-title] ["Evolving GUI"] 550 font
trebuchet Return
a: Area para [] font trebuchet 583x300 (mold/only code)
Pad -8 Scroller 17x300 [
tsize: size-text a
a/para/scroll/y: 280 - tsize/y * face/data
show a
]
Return
Button "Update" 255.200.50 [
attempt [
window-title: tit/text
lay2: layout code: any [attempt [load a/text] code]
lay/pane: lay2/pane
lay/size: lay2/size
lay/feel/detect: func [face event] [
if event/type = 'scroll-line [
a/para/scroll/y: event/offset/y * -15 + a/para/scroll/y
show a
]
event
]
show lay
lay/text: window-title
lay/changes: 'text
show lay
]
]
Button "Copy" 50.240.100 [
write clipboard:// join "view lay: layout code: " mold code
]
Button "Send to [giesse--rebol--it]" [
send/subject [giesse--rebol--it] mold code join "[Evolving GUI] " window-title
]
]
(Has mouse wheel, sending via email...)
GI> With the recent talk about patching
GI> encapped scripts, we don't want to forget that code is data. If you
GI> encap the main portion of your script, but then allow external files
GI> to be used for mods to the encapped "data", your updates could be very
GI> dynamic indeed. :)
Yup, as long as you don't allow the user to execute REBOL code...
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[4/8] from: greggirwin:mindspring at: 23-Nov-2002 16:17
Hi Gabriele,
That's very impressive indeed! With the recent talk about patching
encapped scripts, we don't want to forget that code is data. If you
encap the main portion of your script, but then allow external files
to be used for mods to the encapped "data", your updates could be very
dynamic indeed. :)
-- Gregg
[5/8] from: carl:cybercraft at: 24-Nov-2002 14:36
Hmmm - errors, Gabriele...
Unknown word or style: Btn
Unknown word or style: font
Unknown word or style: trebuchet
Unknown word or style: font-size
Misplaced item: 16
Unknown word or style: bold
Misplaced item: -1x28
** Script Error: Scroller has no value
** Where: do-facets
** Near: Scroller 17x300 [
tsize: size-text a
a/para/scroll/y: 280 - tsize/y * face/data
show a
]
Carl.
On 24-Nov-02, Gabriele Santilli wrote:
> Hello all,
> view lay: layout code: [Do [trebuchet: [name: "Trebuchet MS" size:
<<quoted lines omitted: 40>>
> Regards,
> Gabriele.
--
Carl Read
[6/8] from: anton:lexicon at: 24-Nov-2002 15:26
Mmm, well, he should have noted that you
need the latest view beta for those things.
Anton.
[7/8] from: ronaldoff:free at: 24-Nov-2002 9:26
Hello Gabriele,
Trying your code, Rebol answered :
8<-------------------------------------------------------------------------------------------------
Unknown word or style: Btn
Unknown word or style: font
Unknown word or style: trebuchet
Unknown word or style: font-size
Misplaced item: 16
Unknown word or style: bold
Misplaced item: -1x28
** Script Error: Scroller has no value
** Where: do-facets
** Near: Scroller 17x300 [
tsize: size-text a
a/para/scroll/y: 280 - tsize/y * face/data
show a
]
8<-------------------------------------------------------------------------------------------------
Used View 1.2.1.3.1 and View 1.2.0.8.0.3.1
Did I miss something and if, where ?
-- Best regards,
Ronald
[ronaldoff--free--fr]
[8/8] from: g::santilli::tiscalinet::it at: 24-Nov-2002 13:00
Hi Carl,
On Sunday, November 24, 2002, 3:36:38 AM, you wrote:
CR> Hmmm - errors, Gabriele...
Sorry Carl, that has grown on the beta. :-( You can substitute
Button for Btn and Slider for Scroller, and you need ATTEMPT too
which has been already posted.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted