Handbook
Glossary
on-drag ( gadget -- )
Vocabulary
game-of-life
Inputs
gadget
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
math.order
namespaces
sequences
sequences.private
ui.gadgets
ui.gestures
;
IN:
game-of-life
::
on-drag
( gadget -- )
gadget
size>>
:>
size gadget
grid>>
grid-dim
:>
( rows cols ) gadget
hand-rel
first2
[
size
/i
]
bi@
:>
( i j ) i 0 cols 1
-
between?
j 0 rows 1
-
between?
and
[
last-click
get
i j gadget
grid>>
nth-unsafe
set-nth-unsafe
]
when
gadget
relayout-1
;