Handbook
Glossary
child? ( parent child -- ? )
Factor handbook
»
UI framework
»
Building user interfaces
»
Gadget hierarchy and layouts
»
Layout basics
Prev:
each-child ( ... gadget quot: ( ... child -- ... ) -- ... )
Next:
parents ( gadget -- seq )
Vocabulary
ui
.
gadgets
Inputs
parent
a
gadget
child
a
gadget
Outputs
?
a
boolean
Word description
Tests if
child
is contained inside
parent
.
Definition
USING:
accessors
combinators
kernel
;
IN:
ui.gadgets
:
child?
( parent child -- ? )
{
{
[
2dup
eq?
]
[
2drop
t
]
}
{
[
dup
not
]
[
2drop
f
]
}
[
parent>>
child?
]
}
cond
;