[REBOL] Re: How do I create menus in View
From: allenk:powerup:au at: 9-Jan-2001 23:20
Welcome to the list.
REBOL/View does have menus, but they may not have the look and feel or
operation that you are after, if you are trying to get the feel of an OS.
And implementation of submenus is not something that I would not suggest for
a beginner, (give it a week or two ;-)
The magic function to look at is CHOOSE.
CHOOSE choices function /style styl /window winf /offset xy /across
Generates a choice selector menu, vertical or horizontal.
CHOOSE is a function value.
choices -- Block of items to display (Type: block)
function -- Function to call on selection (Type: function none)
styl -- The style choice button (Type: object)
winf -- The parent window to appear in (Type: object)
xy -- Offset of choice box (Type: pair)
/across -- Use horizontal layout
Here's a little example
; start example
; makes dealing with pairs easier
as-pair: func [xy [block!]][
to-pair reduce xy
choices: func [f [object!]][
choose/offset/window ["Time" "Save" "Quit" "Cancel"]
func [fa e][
switch/default fa/text [
"Time" [hide-popup request/ok form now]
"Save" [hide-popup request/confirm "Save?"]
; set the offset to draw at and the parent-face
as-pair [f/offset/x f/offset/y + f/size/y] f/parent-face
view layout [size 200x200 text "menu" white 40.100.130 center bold [choices
; end example
Hope this helps,
----- Original Message -----
From: "Gunjan Karun" <[gunjan_karun--yahoo--com]>
Sent: Tuesday, January 09, 2001 1:05 AM
Subject: [REBOL] How do I create menus in View
> Hi Gurus,
> I am a kid wrt rebol and am trying out the possibility of using it in our
> Right now I'm exploring the REBOL/View (0.10.38.3.1)
> I have two problems,
> Firstly - Does REBOL/View have the concept of menus (and menu items), if
yes, can anyone kindly give me some pointers where I might explore.
> Secondly - Now that I have installed the REBOL/View on my m/c everytime I
do about on its console, it shows me the version of the View and not of the
core. Is there any way I can find out the version of the REBOL Core on my