Handbook
Glossary
page-elt
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Editor gadgets
»
Documents
»
Document elements
Prev:
paragraph-elt
Next:
doc-elt
Vocabulary
documents
.
elements
Word description
An element representing a page of lines. The
prev-elt
and
next-elt
words return the location of the previous and next page of lines from the current location.
Definition
USING:
math
;
IN:
documents.elements
TUPLE:
page-elt
{
#lines
integer
read-only
initial:
0
}
;
Methods
USING:
accessors
documents
documents.elements
kernel
math
sequences
;
M:
page-elt
next-elt
3dup
[
first
]
[
last-line#
]
[
#lines>>
]
tri*
-
>
[
drop
nip
doc-end
]
[
nip
#lines>>
+line
]
if
;
USING:
accessors
documents
documents.elements
kernel
math
sequences
;
M:
page-elt
prev-elt
nip
2dup
[
first
]
[
#lines>>
]
bi*
<
[
2drop
{
0 0
}
]
[
#lines>>
neg
+line
]
if
;