REBOL Document

Focus - Function Summary


Focuses key events on a specific face.


focus face


face - The face argument.


/no-show - The no-show refinement.


Specify that the face is to receive keyboard input. Normally used with the FIELD and AREA styles.

Only one face can have the focus at a time. The focus can be changed at an time by calling the FOCUS function with a new face. To remove the focus, call the UNFOCUS function.

    out: layout [
        h2 "Focus example:"
        f1: field "field 1"
        f2: field "field 2"
        button "Focus 2" [focus f2]
        button "Focus 1" [focus f1]
        button "Unfocus" [unfocus]
        button "Close" [unview]
    focus f1
    view out

Focus is set automatically when a user clicks on a text face.


unfocus - Removes the current key event focus.

<Back | Index | Next>

Copyright 2004 REBOL Technologies