Home   Archive   Permalink



R2 VID pane usage

I am trying to understand the VID 'facets' and explain them to myself. I have gotten through a number of them and they are specified the same way, namely, a facet word, and then a block of values. In the following example, the MAIN-WINDOW has a box (CONTROL-BUTTONS) with the 'edge' facet followed by the attributes of the edge. I was hoping that the 'pane' facet would be coded in a consistent way, which would be the word 'pane' followed by whatever would be needed to make a sub-window in that pane. Coding it in what seems to me the consistent way (the line that is commented out) produces an error. I can get the desired result by setting CONTROL-BUTTONS/pane as shown, but that way is not consistent with other facets. In other words, I would not set the edge facets that way, but must I set the pane facet in a different way?    
    
So I am wondering, is 'pane' a different kind of 'facet' than 'edge,' or is the paradigm I have in my head about how facets are used a wrong paradigm.
    
Thank you.
    
R E B O L [
     Title: 'VID test harness'
]
;; Paste code below to test
BUTTON-PANE: layout/tight [
     size 196x396
     below
     button 'Button 1'
     button 'button 2'
     button 'button 3'
     button 'button 4'
     button 'button 5'
     button 'button 6'
     button 'button 7'
     button 'button 8'
     button 'button 9'
]
MAIN-WINDOW: layout [
     across
     TEXT-INPUT: area 200x400
     CONTROL-BUTTONS: box 200x400 beige        
         edge [size: 4x4 color: red effect: 'bevel]
;;;;;; pane [BUTTON-PANE] ;; This does not work
]
CONTROL-BUTTONS/pane: BUTTON-PANE ;; This does work
view MAIN-WINDOW


posted by:   Steven White     24-Apr-2015/15:45:01-7:00



LAYOUT doesn't have a facility to set the pane of any face using a PANE keyword, like it does for EDGE.
    
Setting the pane is defined individually for styles, and you would set a pane for a PANEL directly by passing a block. It doesn't work for BOX, because it doesn't take that argument.

posted by:   Henrik     24-Apr-2015/16:22:33-7:00



I'm afraid I am not quite following. I can accept that setting "pane" in the way one would set "edge" does not work for any style. I changed "CONTROL-BUTTONS: box" to "CONTROL-BUTTONS: panel" and tried to set the pane before viewing the window, and that doesn't work. Interestingly, it DID work when CONTROL-BUTTONS was a box.
    
Thank you.
    
MAIN-WINDOW: layout [
     across
     TEXT-INPUT: area 200x400
     CONTROL-BUTTONS: panel 200x400 beige ;; NOTE, panel not box
         edge [size: 4x4 color: red effect: 'bevel]
;;;;; pane [BUTTON-PANE] ;; Does not work ever, for any style
]
CONTROL-BUTTONS/pane: BUTTON-PANE ;; This does work either, for a panel
view MAIN-WINDOW


posted by:   Steven White     24-Apr-2015/17:17:40-7:00



With the last line, you're bypassing LAYOUT and directly accessing the finished face.
    
LAYOUT doesn't have the keyword PANE, which is why it won't ever work.
    
What happens is that each style must search for arguments that in VID may come in the form of a block, string, etc. For TEXT, it's a string, for PANEL, it's a block, for BOX, it's a string again to place text in it, but you can't also pass a block. For arguments, there are no keywords. Keywords are global and work on any face.
    
As such, the argument system in LAYOUT is very limited.

posted by:   Henrik     24-Apr-2015/18:06:06-7:00



Thank you. Slowly it becomes clear(er). This works, and I believe I could explain why if someone asked:    
    
R E B O L [
     Title: "VID test harness"
]
;; Paste code below to test
BUTTON-PANE: [
     size 196x396
     below
     button "Button 1"
     button "button 2"
     button "button 3"
     button "button 4"
     button "button 5"
     button "button 6"
     button "button 7"
     button "button 8"
     button "button 9"
]
view layout [
     across
     TEXT-INPUT: area 200x400
     CONTROL-BUTTONS: panel 200x400 beige
         BUTTON-PANE    
         edge [size: 4x4 color: red effect: 'bevel]
]
    
    


posted by:   Steven White     24-Apr-2015/18:39:19-7:00