Accessing sub-panes to change them.
[1/2] from: reboler:programmer at: 23-Jan-2002 22:25
If I have a face with panes and sub-panes (see below), and buttons to switch between
the sub-panes.
1) How do I access the sub-panes to changes their text, data, color, etc? Button 3 below
does not work? What would?
2) Is there an easy way, like 'center-face to have the sub-panes (red and blue) appear
in the center of the green box?
;*****begin script*****
redpane: layout [origin 0x0 space 0x0 box red 50x50]
bluepane: layout [origin 0x0 space 0x0 area "original" blue 75x75]
redpane/offset: 0x0
bluepane/offset: 0x0
main: layout [
button "1 red" [bx/pane: redpane show bx]
button "2 blue" [bx/pane: bluepane show bx]
bx: box 200x200 green
button "3 change area" [
append clear bluepane/text "changed"
show bluepane
bx/pane: bluepane
show bx
]
]
view main
;*****end script*****
[2/2] from: greggirwin::mindspring::com at: 23-Jan-2002 9:59
Hi Alan,
<< If I have a face with panes and sub-panes (see below), and buttons to
switch between the sub-panes.
1) How do I access the sub-panes to changes their text, data, color, etc?
Button 3 below does not work? What would? >>
Here's a modified version of your code (watch for line wrap). There is more
than one way to skin a cat but, in this case, I just gave the face you
wanted to change (the area face) a name.
redpane: layout [origin 0x0 space 0x0 box red 50x50]
; GSI Added name for area face.
bluepane: layout [origin 0x0 space 0x0 bl-pane-area: area "original" blue
75x75]
redpane/offset: 0x0
bluepane/offset: 0x0
main: layout [
button "1 red" [bx/pane: redpane show bx]
button "2 blue" [bx/pane: bluepane show bx]
bx: box 200x200 green
button "3 change area" [
; GSI Changed text assignment for area face.
;append clear bluepane/text "changed"
bl-pane-area/text: "changed"
show bluepane
bx/pane: bluepane
show bx
]
]
view main
<< 2) Is there an easy way, like 'center-face to have the sub-panes (red and
blue) appear in the center of the green box? >>
Hmmm. I was thinking that center-face, using the /with refinement, would do
the trick, but it doesn't appear to in your case. You should be able to roll
your own without too much difficulty, though there may be some tricky
details we can't forsee.
--Gregg