choice to update a pane
[1/2] from: arolls::bigpond::net::au at: 25-Jun-2001 5:04
Ok, well, I have not really used choose before,
it is a surprise! But you can do this:
choose ["one" "two" "three"] func [a b][probe a/text]
== "one" ; I pressed first item
To put it into a layout:
view center-face layout [
button "choose" [
choose ["one" "two" "three"] func [a b][probe a/text]
]
]
I am not sure what the arguments 'a and 'b are in
the function supplied to 'choose.
Anyway, instead of [probe a/text], you could
change your pane.
I am not sure what exactly you mean by "pane".
In rebol, pane is taken to mean the sub-faces
of a face. You probably are talking in non-rebol
terminology, if so, I think you should call it
panel
in rebol.
To change panels, see documentation:
http://www.rebol.com/how-to.html
Click on "How to Create Subpanels"
or go straight to:
http://www.rebol.com/how-to/subpanels.html
This is my go at it:
do http://users.bigpond.net.au/datababies/anton/rebol/start.r
(I am working on it right now, so there might
be some bugs)
If you need more help, you know who to
call. :)
Anton.
[2/2] from: sanghabum:aol at: 24-Jun-2001 15:49
Francois Prowse [mailto:[fprowse--uu--net]]
> > so if I seleect the 1st option I get a particular pane, the second option
> > a different pane......
<<quoted lines omitted: 5>>
> > all....
> >
Hi Francois,
I think the code below demonstrates what you want.....there's a main panel
and three subpanels. The subpanel is selected by a switch. Before the
selected one is displayed ("Show Mypanel" I have some nonsense code that does
stuff with the variables in each subpanel.
If you literally meant you have fields common to each panel, then I don't
think you can do that: either promote them to the main panel, or repeat the
fields (with different names) in each subpanel.
Hope that helps,
Colin.
===========
rebol [title: "panel example"]
;;define layouts
;;============
mainlayout: layout [my-text-list:
text-list data [1 2 3]
[if (length? my-text-list/picked) = 1
[
;update fields in each subpanel
field1-1/text: mold now
field1-2/text: mold system/stats
field2-1/text: field2-1/text + 1
field3-1/text: field2-1/text + 10
if (field2-1/text // 2)
[field3-2/text: field2-1/text + 10]
switch My-Text-List/picked
[1 [my-panel/pane: panel1]
2 [my-panel/pane: panel2]
3 [my-panel/pane: panel3]
] ; switch
show my-panel
] ; if
] ; action facet
my-panel: box 400x600 ;field for subpanels
] ;layout
Panel1: layout [info "Panel1" Field1-1: info 200 field1-2: info 300]
panel2: layout [info "panel2" Field2-1: info 500]
panel3: layout [info "panel3" field3-1: info 300 field3-2: info 200 ]
;; Initialise data fields befoere view
''=============================
field2-1/text: 1
field3-1/text: 0
unview/all
view mainlayout
halt
===========
-- Attached file included as plaintext by Listar --
Return-Path: <[rebol-bounce--rebol--com]>
Received: from rly-xc01.mx.aol.com (rly-xc01.mail.aol.com [172.20.105.134]) by air-xc04.mail.aol.com
(v78_r3.8) with ESMTP; Sun, 24 Jun 2001 15:14:56 -0400
Received: from brando.rebol.net (brando.rebol.net [63.206.99.2]) by rly-xc01.mx.aol.com
(v79.20) with ESMTP id MAILRELAYINXC17-0624151431; Sun, 24 Jun 2001 15:14:31 -0400
Received: from office.rebol.net (office.rebol.net [63.206.99.3])
by brando.rebol.net (8.10.1/8.10.1) with ESMTP id f5OJ6xL26709;
Sun, 24 Jun 2001 12:06:59 -0700
Received: from office.rebol.net (localhost [127.0.0.1])
by office.rebol.net (8.10.1/8.10.1) with ESMTP id f5OJ68Q30134;
Sun, 24 Jun 2001 12:06:08 -0700
Received: with LISTAR (v0.129a; list rebol); Sun, 24 Jun 2001 12:06:08 -0700 (PDT)
Received: from brando.rebol.net (IDENT:[root--brando--rebol--net] [63.206.99.2])
by office.rebol.net (8.10.1/8.10.1) with ESMTP id f5OJ67Q30129
for <[rebol-list--lists--rebol--net]>; Sun, 24 Jun 2001 12:06:07 -0700
Received: from hitchcock.mail.mindspring.net (hitchcock.mail.mindspring.net [207.69.200.23])
by brando.rebol.net (8.10.1/8.10.1) with ESMTP id f5OJ66L26696
for <[rebol-list--rebol--net]>; Sun, 24 Jun 2001 12:06:07 -0700
Received: from augustus (augustus-z.mspring.net [207.69.231.21])
by hitchcock.mail.mindspring.net (8.9.3/8.8.5) with SMTP id PAA25749
for <[rebol-list--rebol--net]>; Sun, 24 Jun 2001 15:06:06 -0400 (EDT)
X-MindSpring-Loop: [rebol-list--rebol--com]
Received: from mailin6.bigpond.com ([139.134.6.79])
by augustus (Earthlink Mail Service) with ESMTP id tjcegs.15d.37kbpol
for <[rebol-list--rebol--com]>; Sun, 24 Jun 2001 15:06:04 -0400 (EDT)
Received: from machine ([139.134.4.52]) by mailin6.bigpond.com
(Netscape Messaging Server 4.15) with SMTP id GFG7ZG00.ENE; Mon,
25 Jun 2001 05:11:40 +1000
Received: from CPE-144-132-13-47.vic.bigpond.net.au ([144.132.13.47]) by mail5.bigpond.com
(Claudes-Volcanic-MailRouter V2.9c 9/6230191); 25 Jun 2001 05:06:30
From: "Anton" <[arolls--bigpond--net--au]>
To: <[rebol-list--rebol--com]>
Cc: "Francois Prowse" <[fprowse--uu--net]>
Subject: [REBOL] Re: choice to update a pane
Date: Mon, 25 Jun 2001 05:04:47 +1000
Message-ID: <[NOEDJEJPNBNKDKGDCALOOEKKCGAA--arolls--bigpond--net--au]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <[Pine--GSO--4--21--0106241355280--17541-100000--anocserve1--ams--ops--eu--uu--net]>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-archive-position: 8200
X-listar-version: Listar v0.129a
X-original-sender: [arolls--bigpond--net--au]
Precedence: bulk
Reply-to: [rebol-list--rebol--com]
X-list: rebol
Ok, well, I have not really used choose before,
it is a surprise! But you can do this:
choose ["one" "two" "three"] func [a b][probe a/text]
== "one" ; I pressed first item
To put it into a layout:
view center-face layout [
button "choose" [
choose ["one" "two" "three"] func [a b][probe a/text]
]
]
I am not sure what the arguments 'a and 'b are in
the function supplied to 'choose.
Anyway, instead of [probe a/text], you could
change your pane.
I am not sure what exactly you mean by "pane".
In rebol, pane is taken to mean the sub-faces
of a face. You probably are talking in non-rebol
terminology, if so, I think you should call it
panel
in rebol.
To change panels, see documentation:
http://www.rebol.com/how-to.html
Click on "How to Create Subpanels"
or go straight to:
http://www.rebol.com/how-to/subpanels.html
This is my go at it:
do http://users.bigpond.net.au/datababies/anton/rebol/start.r
(I am working on it right now, so there might
be some bugs)
If you need more help, you know who to
call. :)
Anton.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted