[REBOL] face-offset face function
From: maximo::meteorstudios::com at: 7-Jan-2004 19:29
hi all,
I just tought I'd share a little function I add to the base face object of many of my
view windows...
(use the 'with facet in VID)
;---8<---------------------------------------------
;- face-offset ()
face-offset: function [/stop-face sface] [parent off][
parent: self
off: 0x0
until [
off: off + parent/offset
if parent/parent-face [
if parent/parent-face/edge [
off: off + parent/parent-face/edge/size
]
]
(((parent: parent/parent-face) = sface) OR ( not parent ))
]
off
]
;---8<---------------------------------------------
It is like the rebol win-offset function but includes the edge fix AND also includes
a stop face.
The stop-face refinement lets you supply any face so that you can get the offset of a
face wrt to any of its parents (instead of only the window).
As mentionned before, in its current format, it is intended to be included as a method
of a face object, but can easiliy be made as a stand-alone function.
cheers!!!
-MAx
---
happy like a busy bee cause I'm currently using rebol for my day job, full-time. :-)