GUI: PLT Graphics Toolkit

1`` | Overview
- | Windowing
- | Drawing
- | Editor
2`` | Reference
- | Windowing Classes
- | Windowing Functions
- | Drawing Classes
- | Drawing Functions
- | Editor Classes
- | Editor Functions
- | WXME Decoding
3`` | Configuration
4`` | Dynamic Loading
| Index

On this page:

find-or-create-pen

Version: 4.0.2
contents index
← prev up next →

pen-list% : class?
superclass: object%

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

A global pen list the-pen-list is created automatically.

(make-object pen-list%) → (is-a?/c pen-list%)

Creates an empty pen list.

(send a-pen-list find-or-create-pen |  | color |  |  |  |
|  | width |  |  |  |
|  | style) |  | → |  | (is-a?/c pen%)

color : (is-a?/c color%)
width : (real-in 0 255)

style

:

(one-of/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)

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

→ (or/c (is-a?/c pen%) false/c)
color-name : string?
width : (real-in 0 255)

style

:

(one-of/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)

Finds a pen of the given specification, or creates one and adds it to the list. The arguments are the same as for creating a pen% instance. When color-name is provided, however, the return value is #f when no color matching color-name can be found in the-color-database.

contents index
← prev up next →