Handbook
Glossary
screen-loc ( gadget -- loc )
Factor handbook
»
UI framework
»
Building user interfaces
»
Gadget geometry
Prev:
relative-loc ( fromgadget togadget -- loc )
Next:
pick-up ( point gadget -- child/f )
Vocabulary
ui
.
gadgets
Inputs
gadget
a
gadget
Outputs
loc
a pair of integers
Word description
Outputs the location of the gadget relative to the top-left corner of the world containing the gadget. This word does not output a useful value if the gadget is not grafted.
Definition
USING:
accessors
math.vectors
sequences
;
IN:
ui.gadgets
:
screen-loc
( gadget -- loc )
parents
{
0 0
}
[
loc>>
v+
]
reduce
;