REBOL Document

Center-face - Function Summary


Center a face on screen or relative to another face.


center-face obj


obj - The obj argument. (must be: object)


/with - Center relative to a face.

face - The face argument. (must be: object)


This function is used for centering a face relative to the screen or relative to other faces. It is useful for displaying dialog boxes or other types of windows that require the user's attention.

In the example below, a layout face is shown in its default position, then it is displayed in the center of the screen.

    out1: layout [
        vh2 "Bust'n Chops"
        body "With the Internet we're bust'n chops worldwide."
    view out1
    center-face out1
    view out1

To position a face relative to another face use the /with refinement.

    out2: layout [vh2 "Ok boss."]
    out1/offset: 200x200
    center-face/with out2 out1
    view/new out1
    view/new out2
    wait 1

The out2 face is centered over the out1 face.

<Back | Index | Next>

Copyright 2004 REBOL Technologies