Home   Archive   Permalink



How to use a face in a layout?

Where can I find an example of a view including a
    
make face
and a button?

posted by:   OneArb     6-Dec-2018/4:34:07-8:00



my-window: center-face make face [
     size: 220x50
]
    
my-window/pane: collect [
     keep make-face/spec 'button [
         size: 200x30
         offset: 10x10
         text: "Press"
         action: [alert "Pressed!"]
     ]
]
    
view my-window

posted by:   Chris     6-Dec-2018/12:32:53-8:00



Docs:
    
http://www.rebol.com/docs/view-face-funcs.html
    
http://www.rebol.com/docs/view-guide.html#section-73
    
More generally:
    
http://www.rebol.com/docs/view-face-object.html
    
http://www.rebol.com/docs/view-system.html

posted by:   Chris     6-Dec-2018/12:38:37-8:00



I am trying to create a custom face I can reuse in a layout.
    
How can I create a face I can use like a standard face?

posted by:   OneArb     11-Dec-2018/10:56:30-8:00



Do you have some pseudocode for what you're trying to do?
    
You can customize buttons or other custom styles in VID using STYLE and STYLIZE:
    
view layout [
     style BLUE-BUTTON: BUTTON blue with [
         additions-to-the-underlying-face-object: yes
     ]
     blue-button "I'm Blue"
     blue-button "So am I"
]


posted by:   Chris     16-Dec-2018/23:10:05-8:00