11 Interactive Value Port

▼ |  | Mr Lib: Extra GUI Libraries

1 | Aligned Pasteboard
2 | Arrow Toggle Snip
3 | Bitmap Label
4 | Cache-image Snip
5 | Close Icon
6 | Expandable Snip
7 | GIF and Animated GIF Writing
8 | Graphs
9 | Hierarchical List Control
10 | Include Bitmap
11 | Interactive Value Port
12 | Name Message
13 | Path Dialog
14 | Plot
15 | Switchable Button
16 | Image Core
17 | Matrix Snip
18 | Snip Canvases
19 | Syntax Browser
20 | Te X Table
21 | Terminal Window
22 | White on Black Panel Predicate
23 | Acknowledgments
| Index

On this page:

set-interactive-display-handler
set-interactive-write-handler
set-interactive-print-handler

top contents ← prev up next →

### 11`` Interactive Value Port🔗ℹ

(require mrlib/interactive-value-port) | package: gui-lib

> > procedure
> > (set-interactive-display-handler |  | port |
> > | [ | #:snip-handler snip-handler]) |
> → void?
> port : output-port?
> | snip-handler |  | : |  | (or/c #f (-> (is-a?/c snip%) output-port? any))
> |  |  | = |  | #f

Sets port’s display handler (via port-display-handler) so that when it encounters these values:

- syntax objects

- snips

it uses write-special to send snips to the port and uses mrlib/syntax-browser to turn syntax object into snips and then uses write-special with the result to send it to the port. Otherwise, it behaves like the default handler.

If snip-handler is not #f, then set-interactive-display-handler passes any snips to it (not those it creates by mrlib/syntax-browser) instead of calling write-special.

To show values embedded in lists and other compound object, it uses pretty-display.

> > procedure
> > (set-interactive-write-handler |  | port |
> > | [ | #:snip-handler snip-handler]) |
> → void?
> port : output-port?
> | snip-handler |  | : |  | (or/c #f (-> (is-a?/c snip%) output-port? any))
> |  |  | = |  | #f

Like set-interactive-display-handler, but sets the port-write-handler and uses pretty-write.

> > procedure
> > (set-interactive-print-handler |  | port |
> > | [ | #:snip-handler snip-handler]) |
> → void?
> port : output-port?
> | snip-handler |  | : |  | (or/c #f (-> (is-a?/c snip%) output-port? any))
> |  |  | = |  | #f

Like set-interactive-display-handler, but sets the port-print-handler and uses pretty-print.
top contents ← prev up next →