Hello All
Complete REBOL (programming in general) novice here.
Using REBOL/View 1.3.2.4.2 7-Dec-2005 Core 2.6.3
and RebGUI "RebGUI widget tour" 0.4.40
on linux (puppy 213)
I am in need of some help/advice from those who know the score.
After umpteen fruitless searches (google) i am left with no option
but to post this,so please excuse my Newbity.
First let me explain.
THE FOLLOWING WAS DONE PURELY AS AN EDUCATIONAL EXERCISE.
What i am trying to achieve is a little widget that allows the user
to select (from a drop-down list) a colour that is then displayed in a box
below the drop-down list.
This widget will contain 6 of the above mentioned (drop-down list/box combo's)
across the window.
A sort of Colours Pick n Mix
In fact such a widget (almost) exists in the RebGUI tour.r ,on the List tab.
So without further ado, i set about chopping the tour.r file (hope that is allowed)
to try and get it down to something like i require.
I also added extra colours to the drop-down list.
Now its nearly there, albeit still in need of a few tweaks here and there.
My main problem is this.
Select any colour in any list (of the 6),and ONLY the box below list 6 is changing colour.
if you run the following code, you will see what i mean.
REBOL []
#include %rebgui.r
unless value? 'ctx-rebgui [
either exists? %rebgui-ctx.r [do %rebgui-ctx.r] [do %rebgui.r]
]
fonts: reduce [font-sans-serif font-fixed font-serif "verdana"]
do show-tour: make function! [] [
display rejoin [""] [
group-box "Choose Window Colour" data [
button-size 20
after 2
button "window" [if var: request-color [ctx-rebgui/colors/window: var unview show-tour]] box 10x5 edge [color: black] ctx-rebgui/colors/window
] return
text "Select From List" return
group-box "Colour-1" data [
drop-list 30 "Select Colour 1" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 red
]
group-box "Colour-2" data [
drop-list 30 "Select Colour 2" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 yellow
]
group-box "Colour-3" data [
drop-list 30 "Select Colour 3" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 green
]
group-box "Colour-4" data [
drop-list 30 "Select Colour 4" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 blue
]
group-box "Colour-5" data [
drop-list 30 "Select Colour 5" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 silver
]
group-box "Colour-6" data [
drop-list 30 "Select Colour 6" data ["aqua" "beige" "blue" "brown" "coffee" "cyan" "gold" "green" "khaki" "linen" "maroon" "navy" "olive" "papaya" "pink" "reblue" "red" "silver" "snow" "teal" "water" "white" "base-color" "black" "brick" "coal" "crimson" "forest" "gray" "ivory" "leaf" "magenta" "mint" "oldrab" "orange" "pewter" "purple" "rebolor" "sienna" "sky" "tan" "violet" "wheat" "yellow"] [show-color ex-drop-list to word! face/text] return
ex-drop-list: box 30x50 papaya
]
]
]
do-events
My Questions are:
1. How do i get each box to display the colour chosen from the list immediately above it. ?
2. How would i go about getting the box's to actually touch each other. ?
(so there is no window colour showing between them).
Sorry if this seems rather simple, but maybe its me who is simple, as i cannot get it to work
Anyhow hope somebody may be able to help
TIA. ARU