Handbook
Glossary
scroll>caret ( editor -- )
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Editor gadgets
»
The caret and mark
Prev:
remove-selection ( editor -- )
Vocabulary
ui
.
gadgets
.
editors
Inputs
editor
an
editor
Outputs
None
Word description
Ensures that the caret becomes visible in a
scroller
containing the editor. Does nothing if no parent of
gadget
is a
scroller
.
Definition
USING:
accessors
kernel
math.rectangles
math.vectors
sequences
ui.gadgets.scrollers
;
IN:
ui.gadgets.editors
:
scroll>caret
( editor -- )
dup
graft-state>>
second
[
[
[
caret-loc
]
[
caret-dim
{
2 1
}
v+
]
bi
<rect>
]
keep
scroll>rect
]
[
drop
]
if
;