Handbook
Glossary
pick-up ( point gadget -- child/f )
Factor handbook
»
UI framework
»
Building user interfaces
»
Gadget geometry
Prev:
screen-loc ( gadget -- loc )
Next:
children-on ( rect gadget -- seq )
Vocabulary
ui
.
gadgets
Inputs
point
a pair of integers
gadget
a
gadget
Outputs
child/f
a
gadget
or
f
Word description
Outputs the child at a point in the gadget's coordinate system. This word recursively descends the gadget hierarchy, and so outputs the deepest child.
Definition
USING:
accessors
kernel
math.rectangles
math.vectors
sequences
;
IN:
ui.gadgets
:
pick-up
( point gadget -- child/f )
2dup
[
dup
point>rect
]
dip
children-on
[
contains-point?
]
with
find-last
nip
or?
[
[
loc>>
v-
]
[
pick-up
]
bi
]
[
nip
]
if
;