Rebol is much more than just a shell scripting language. Rebol has an intelligent GUI dialect (DSL or Domain Specific Language in Rebol’s parliance) called VID (Visual Interface Dialect). This feature is within Rebol nearly since inception well before Dotnet and JavaFX (you may perceive that JavaFX syntax is strangely familiar with Rebol’s Syntax, maybe they get inspired by rebol without acknowledging it like in BlueJ’s rant and then ZDNet’s article “Microsoft copies BlueJ, admits it, then patents it”). With it, you could for example develop a full blown GUI instant messenger in 7K.
In this post, you’ll also discover how easily you can write and test your code little by little using Rebol console - you will love this if you’re a fan of Agile Methodology.
So let’s start.
Launch Rebol Console.


Type this first instruction:
window: layout [h2 "VID Tutorial"]
Validate … nothing happens, well because you now need to show the window with next instruction:
view window

That is much better: you will see this window

For explanation, Rebol uses the concept of layout a block of special words describing a window content.
Now, let’s see how to create text fields by just copying and pasting the code below into Rebol Console (Validate to execute it):
window: layout [
h2 "Account Information"
text "Please enter your account details here."
across
label "First name" tab field "Enter First Name"
return
label "Last name" tab field "Enter Last Name"
return
label "Email" tab field
return
label "City" tab field
return
tab button "Submit"
button "Cancel"
]
View window
across is a VID keyword which sets layout to horizontal direction.
Pictures below show the result:


To make the button react to the mouse click just add a block instruction at the end like this
button "Submit" [print "Submitted"]
button "Cancel" [print "Cancelled"]

That’s all Folks!
Next installment will show you How to bind a Mini-Text Database with your Visual GUI.















Tags: VID