File: snip-procs.scrbl

package info (click to toggle)
racket 7.9%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 178,684 kB
  • sloc: ansic: 282,112; lisp: 234,887; pascal: 70,954; sh: 27,112; asm: 16,268; makefile: 4,613; cpp: 2,715; ada: 1,681; javascript: 1,244; cs: 879; exp: 499; csh: 422; python: 274; xml: 106; perl: 104
file content (62 lines) | stat: -rw-r--r-- 1,960 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#lang scribble/doc
@(require "common.rkt")

@title[#:tag "snip-related-functions"]{Snip Functions}

@defproc[(snip-width [snip (is-a?/c snip%)]) real?]{

The width of a snip in the parent pasteboard.}

@defproc[(snip-height [snip (is-a?/c snip%)]) real?]{

The height of a snip in the parent pasteboard.}

@defproc[(snip-min-width [snip (is-a?/c snip%)]) real?]{

The minimum width of the snip}

@defproc[(snip-min-height [snip (is-a?/c snip%)]) real?]{

The minimum height of the snip.}

@defproc[(snip-parent [snip (is-a?/c snip%)]) (is-a?/c pasteboard%)]{

The pasteboard that contains the snip.}

@defproc[(fold-snip [f ((is-a?/c snip%) any/c . -> . any/c)]
                    [init-acc any/c]
                    [snip (is-a?/c snip%)])
          any/c]{

Applies @racket[f] to all snips in the parent of @racket[snip], 
starting with @racket[snip].}

@defproc[(for-each-snip [f ((is-a?/c snip%) . -> . any/c)]
                        [first-snip (is-a?/c snip%)] 
                        [more list?] ...)
         void?]{

Applies the function to each snip in the parent of
@racket[first-snip], starting with @racket[first-snip]. If
@racket[more] lists are supplied, they are used for extra arguments to
@racket[f], just like extra lists provided to @racket[for-each].}

@defproc[(map-snip [f ((is-a?/c snip%) . -> . any/c)]
                   [first-snip (is-a?/c snip%)] 
                   [more list?] ...)
         void?]{

Applies the function to each snip in the parent of
@racket[first-snip], starting with @racket[first-snip], and
accumulates the results into a list. If @racket[more] lists are
supplied, they are used for extra arguments to @racket[f], just like
extra lists provided to @racket[map].}


@defproc[(stretchable-width? [snip (is-a?/c snip%)]) boolean?]{

True if the snip can be resized in the X dimension.}

@defproc[(stretchable-height? [snip (is-a?/c snip%)]) boolean?]{

True if the snip can be resized in the Y dimension.}