Hi Silvia,

Gabriele explained well, but I would just like to clarify a few things:

- LAYOUT produces a *face* which contains other faces depending
  on the VID dialect you provide.

- It is actually the VIEW function which makes the containing face
  into a window face, although LAYOUT may do a few things to prepare
  it for this purpose.

That is why we create windows this way:

        ; create a face containing a button face
        window: layout [button "example"]

        ; I have called the new face WINDOW, but it is not
        ; really a window yet..

        view window

        ; now WINDOW is actually a window face.

To see the basics of how LAYOUT and VIEW work, we can mimic
their behaviour at a low level (the "face level"):

        ; This is like LAYOUT
        window: make face [offset: 30x50]

        ; WINDOW is just a blank face - no button inside.
        ; (you will have to do that yourself)

        ; This is like VIEW
        append system/view/screen-face/pane window
        show system/view/screen-face
        do-events

The gray window that pops up does not look the same as the top
example, but the idea is the same.

Regards,

Anton.

> Hi Silvia,
>
> On Monday, October 31, 2005, 6:40:31 PM, you wrote:
>
> SB> What is the difference between a face and a layout? I can't understand
> SB> exactly how can I use them and if using one of them instead
> of the other
> SB> produces different results.
>
> A  face is a rectangular section of the screen; a window is a face
> too. A face can contain other faces inside it.
>
> LAYOUT  is a function that produces a window face with other faces
> in  it  based  on  the  VID dialect you provide. So, the result of
> LAYOUT is actually a face.
>
> LAYOUT,  taking  a  dialect  block,  is  much more high level that
> creating faces directly, which are more low level.
>
> Hope this gets you started. :)
>
> Regards,
>    Gabriele.

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to