2.3.4 brush-list%

► |  | GUI: Racket Graphics Toolkit

1 | Overview
2 | Reference
3 | Configuration
4 | Dynamic Loading
| Bibliography
| Index

► | 2 | Reference

2.1 | Windowing Classes
2.2 | Windowing Functions
2.3 | Drawing Classes
2.4 | Drawing Functions
2.5 | Editor Classes
2.6 | Editor Functions
2.7 | WXME Decoding

▼ | 2.3 | Drawing Classes

2.3.1 | bitmap%
2.3.2 | bitmap-dc%
2.3.3 | brush%
2.3.4 | brush-list%
2.3.5 | color%
2.3.6 | color-database<%>
2.3.7 | dc<%>
2.3.8 | dc-path%
2.3.9 | font%
2.3.10 | font-list%
2.3.11 | font-name-directory<%>
2.3.12 | gl-config%
2.3.13 | gl-context<%>
2.3.14 | pen%
2.3.15 | pen-list%
2.3.16 | point%
2.3.17 | post-script-dc%
2.3.18 | printer-dc%
2.3.19 | ps-setup%
2.3.20 | region%

On this page:

find-or-create-brush

top← prev up next →

brush-list% : class?
superclass: object%

A brush-list% object maintains a list of brush% objects to avoid creating brushes repeatedly. A brush% object in a brush list cannot be mutated.

A global brush list, the-brush-list, is created automatically.

( new brush-list%) → ( is-a?/c brush-list%)

Creates an empty brush list.

( send a-brush-list find-or-create-brush |  | color |
|  | style) |

→ ( is-a?/c brush%)
color : ( is-a?/c color%)

style

:

( one-of/c 'transparent 'solid 'opaque
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)

( send a-brush-list find-or-create-brush |  | color-name |
|  | style) |

→ ( or/c ( is-a?/c brush%) false/c)
color-name : string?

style

:

( one-of/c 'transparent 'solid 'opaque
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)

Finds a brush of the given specification, or creates one and adds it to the list. See brush% for a further explanation of the arguments, which are the same as brush%’s initialization arguments.
top← prev up next →