On 04-Jan-04, Defiant Mail wrote:

> Tried the below but the button shows up at default (25x25)

> Rebol[]

> view center-face  layout [
> size system/view/screen-face/size
> button "OK" [unview]]

This I think does what you want...

screen-size: 200x100 ;system/view/screen-face/size
view center-face layout [
    size screen-size
    b: button "OK" [unview]
    do [b/offset: screen-size / 2 - (b/size / 2)]
]

Note you could also get the screen size by looking at
b/parent-face/size, but not until after the layout had been VIEWed,
so it can't be used in the DO block above.  A feel function that's
called when the layout's first VIEWed and when it's resized would be
one way to put parent-face to work.

HTHs.

-- 
Carl Read

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to