On this page:
find-or-create-brush

class

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.

constructor

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

Creates an empty brush list.

method

(send a-brush-list find-or-create-brush color 
  style) 
  (is-a?/c brush%)
  color : (is-a?/c color%)
  style : 
(or/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%) #f)
  color-name : string?
  style : 
(or/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.