Jump to content

Rebol Programming/clear-fields

From Wikibooks, open books for an open world

USAGE:

[edit | edit source]
CLEAR-FIELDS panel 

DESCRIPTION:

[edit | edit source]

Clear all text fields faces of a layout.

CLEAR-FIELDS is a function value.

ARGUMENTS

[edit | edit source]
  • panel -- (Type: object)

SOURCE CODE

[edit | edit source]
clear-fields: func [
    "Clear all text fields faces of a layout." 
    panel [object!]
][
    if not all [in panel 'type panel/type = 'face] [exit] 
    unfocus 
    foreach face panel/pane [
        if all [series? face/text flag-face? face field] [
            clear face/text 
            face/line-list: none
        ]
    ]
]