REBOL Programming/win-offset?

From Wikibooks, open books for an open world
< REBOL Programming
Jump to: navigation, search

USAGE:[edit]

WIN-OFFSET? face 

DESCRIPTION:[edit]

Returns the offset of a face within its window.

WIN-OFFSET? is a function value.

ARGUMENTS[edit]

  • face -- (Type: object)

SOURCE CODE[edit]

win-offset?: func [
    "Returns the offset of a face within its window." 
    face [object!] 
    /local xy
][
    xy: 0x0 
    while [face/parent-face] [
        xy: xy + face/offset 
        face: face/parent-face 
        if face/edge [xy: xy + face/edge/size]
    ] 
    xy
]