Download PDF file (516K bytes)

Transcript
Chapter 5: Curses Reference
66
The return value of these routines are undefined. They can throw an exception if
curses is in a bad state.
The attr-set! and related routines do not affect the attributes used when erasing
portions of the window. For functions which modify the attributes used for erasing and
clearing See Section 5.2.10 [Window background manipulation routines], page 67.
color-set! win color-pair-number
[Procedure]
The routine color-set! sets the current color of the given window to the foreground/background combination described by the color-pair-number.
The return value is unspecified, but, it can throw an error if the color pair number
was too large.
[Procedure]
The routine attr-get returns the current attribute and color pair for the given window. They are returned as a list containing two elements. The first element is a
bitmap containing all the attributes. The second element is the color pair alone.
attr-get
chgat win n attr color #:key y x
[Procedure]
The routine chgat changes the attributes of a given number of characters starting at
the current cursor location of stdscr or of win if it is given. It does not update the
cursor and does not perform wrapping. A character count of -1 or greater than the
remaining window width means to change attributes all the way to the end of the
current line. If y and x are given, the function does a cursor move before acting. In
these functions, the color argument is a color-pair index as in the first argument of
init-pair!. See Section 5.2.13 [Color manipulation routines], page 69.
The return value is unspecified.
The attributes can be passed to the routines attr-on!, attr-off!, and attr-set!, or
logior’d with the characters passed to addch. For the color part of the rendition, use
color-pair. See Table 5.2.
color-pair n
[Procedure]
Returns a bit mask to apply the color pair n to a rendition. color-pair values can
only be logior’ed with attributes if the pair number is less than 256. The alternate
functions such as color-set! can pass a color pair value directly.
For example, the following two calls are equivalent ways of setting the default attribute
of the screen to be bold and have color-pair #1.
(attr-set! win (logior A_BOLD (color-pair 1)))
or
(attr-set! win A_BOLD 1)
pair-number attrs
This function is the inverse operation of color-pair. It is rarely useful.
(color-pair 1) ==> 256
(pair-number 256) ==> 1
[Procedure]