▼ |  | Mr Lib: Extra GUI Libraries

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

On this page:

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

top ← prev up next →

### 9`` 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 ← prev up next →