Handbook
Glossary
graft* ( gadget -- )
Factor handbook
»
UI framework
»
Building user interfaces
»
Top-level windows
Prev:
worlds
Next:
ungraft* ( gadget -- )
Vocabulary
ui
.
gadgets
Inputs
gadget
a
gadget
Outputs
None
Generic word contract
Called to notify the gadget it has become visible on the screen. This should set up timers and threads, and acquire any resources used by the gadget.
See also
graft
,
ungraft
,
ungraft*
Definition
IN:
ui.gadgets
GENERIC:
graft*
( gadget -- )
Methods
USING:
L-system
accessors
opengl.gl
ui.gadgets
ui.gadgets.worlds
;
M::
L-system
graft*
( L-SYSTEM -- )
L-SYSTEM
find-gl-context
1
glGenLists
L-SYSTEM
display-list<<
;
USING:
accessors
audio.engine
audio.gadget
audio.gadget.private
generic
kernel
namespaces
ui.gadgets
;
M:
audio-gadget
graft*
[
M\
audio-gadget
graft*
(call-next-method)
]
[
dup
audio>>
[
gadget-audio-engine
get-global
f
]
dip
f
<static-audio-clip>
>>audio-clip
drop
]
bi
;
USING:
compiler.units
generic
kernel
ui.gadgets
ui.tools.browser
;
M:
browser-gadget
graft*
[
add-definition-observer
]
[
M\
browser-gadget
graft*
(call-next-method)
]
bi
;
USING:
accessors
bubble-chamber
generic
kernel
timers
ui.gadgets
;
M:
bubble-chamber
graft*
[
timer>>
start-timer
]
[
M\
bubble-chamber
graft*
(call-next-method)
]
bi
;
USING:
accessors
cairo-demo
cairo-demo.private
kernel
ui.gadgets
;
M:
cairo-demo-gadget
graft*
dup
dup
init-cairo
swap
cairo-t<<
draw-hello-world
;
USING:
generic
kernel
ui.gadgets
ui.tools.button-list
;
M:
clickable
graft*
[
store-labelled-button
drop
]
[
M\
clickable
graft*
(call-next-method)
]
bi
;
USING:
accessors
kernel
namespaces
timers
ui.gadgets
ui.gadgets.editors
ui.gadgets.editors.private
;
M:
editor
graft*
[
dup
caret>>
activate-editor-model
]
[
dup
mark>>
activate-editor-model
]
[
[
[
blink-caret
]
curry
blink-interval
get
dup
<timer>
]
keep
blink-timer<<
]
tri
;
USING:
accessors
escape-strings.ui
generic
kernel
models
ui.gadgets
;
M:
escape-string-editor
graft*
[
dup
source-model>>
add-connection
]
[
M\
escape-string-editor
graft*
(call-next-method)
]
bi
;
USING:
accessors
generic
kernel
minesweeper
timers
ui.gadgets
;
M:
grid-gadget
graft*
[
timer>>
start-timer
]
[
M\
grid-gadget
graft*
(call-next-method)
]
bi
;
USING:
accessors
generic
kernel
models
ui.gadgets
ui.tools.listener
;
M:
interactor
graft*
[
M\
interactor
graft*
(call-next-method)
]
[
dup
word-model>>
add-connection
]
bi
;
USING:
accessors
kernel
roms.space-invaders
system
threads
ui.gadgets
;
M:
invaders-gadget
graft*
dup
cpu>>
init-sounds
f
>>quit?
[
nano-count
swap
invaders-process
]
curry
"Space invaders"
spawn
drop
;
USING:
jamshred
jamshred.gl
kernel
threads
ui.gadgets
ui.gadgets.worlds
;
M:
jamshred-gadget
graft*
[
find-gl-context
init-graphics
]
[
[
jamshred-loop
]
curry
in-thread
]
bi
;
USING:
accessors
game.input.demos.joysticks
kernel
timers
ui.gadgets
;
M:
joystick-demo-gadget
graft*
dup
[
update-axes
]
curry
FREQUENCY
every
>>timer
drop
;
USING:
accessors
game.input
game.input.demos.key-caps
kernel
timers
ui.gadgets
;
M:
key-caps-gadget
graft*
open-game-input
dup
[
update-key-caps-state
]
curry
FREQUENCY
every
>>timer
drop
;
USING:
generic
kernel
ui.gadgets
ui.tools.listener
;
M:
listener-gadget
graft*
[
M\
listener-gadget
graft*
(call-next-method)
]
[
restart-listener
]
bi
;
USING:
accessors
kernel
models
ui.gadgets
ui.gadgets.editors
;
M:
model-field
graft*
[
[
field-model>>
value>>
]
[
editor>>
]
bi
set-editor-string
]
[
dup
editor>>
model>>
add-connection
]
bi
;
USING:
accessors
kernel
models
ui.gadgets
ui.gadgets.controls
ui.gadgets.editors
;
M:
model-field
graft*
[
[
model*>>
value>>
]
[
editor>>
]
bi
set-editor-string
]
[
dup
editor>>
model>>
add-connection
]
[
dup
model*>>
add-connection
]
tri
;
USING:
accessors
kernel
nehe.4
threads
ui.gadgets
;
M:
nehe4-gadget
graft*
f
>>quit?
[
nehe4-update-thread
]
curry
in-thread
;
USING:
accessors
kernel
nehe.5
threads
ui.gadgets
;
M:
nehe5-gadget
graft*
f
>>quit?
[
nehe5-update-thread
]
curry
in-thread
;
USING:
kernel
ui.gadgets
;
M:
object
graft*
drop
;
USING:
accessors
combinators
ui.gadgets
ui.gadgets.slate
;
M:
slate
graft*
graft>>
( -- )
call-effect
;
USING:
accessors
calendar
kernel
snake-game.sprites
snake-game.ui
timers
ui.gadgets
;
M:
snake-gadget
graft*
dup
[
do-updates
]
curry
200
milliseconds
every
>>timer
snake-textures
>>textures
drop
;
USING:
accessors
calendar
kernel
tetris
timers
ui.gadgets
;
M:
tetris-gadget
graft*
[
[
tick
]
curry
100
milliseconds
every
]
keep
timer<<
;
USING:
accessors
generic
kernel
lcd
timers
ui.gadgets
;
M:
time-display
graft*
[
timer>>
start-timer
]
[
M\
time-display
graft*
(call-next-method)
]
bi
;
USING:
accessors
generic
kernel
timers
trails
ui.gadgets
;
M:
trails-gadget
graft*
[
timer>>
start-timer
]
[
M\
trails-gadget
graft*
(call-next-method)
]
bi
;
USING:
continuations
kernel
ui.backend
ui.gadgets
ui.gadgets.worlds
ui.private
;
M:
world
graft*
[
(open-window)
]
[
[
set-up-window
]
[
]
[
clean-up-broken-window
]
cleanup
]
bi
;