Handbook
Glossary
set-scroll-position ( value scroller -- )
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Scroller gadgets
Prev:
scroll-position ( scroller -- loc )
Next:
scroll>bottom ( gadget -- )
Vocabulary
ui
.
gadgets
.
scrollers
Inputs
value
a pair of integers
scroller
a
scroller
Outputs
None
Word description
Sets the offset of the top-left corner of the scroller's
viewport
's child.
See also
scroll-position
,
scroll>bottom
,
scroll>top
,
scroll>rect
Definition
USING:
accessors
arrays
kernel
sequences
ui.gadgets
;
IN:
ui.gadgets.scrollers
:
set-scroll-position
( value scroller -- )
[
viewport>>
[
dim>>
{
0 0
}
]
[
gadget-child
pref-dim
]
bi
4array
flip
]
keep
2dup
control-value
=
[
2drop
]
[
set-control-value
]
if
;