On this page:
find-or-create-brush

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.

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.