17 Terminal Window

▼ |  | 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 | Te X Table
17 | Terminal Window
18 | Acknowledgments
| Index

On this page:

in-terminal
on-terminal-run

top ← prev up next →

### 17`` Terminal Window

(require mrlib/terminal)

The mrlib/terminal library provides a simple GUI wrapper around functions that normally would run in command-line scripts.

> > procedure
> > (in-terminal |  | doit |  |  |  |
> > | [ | #:cleanup-thunk cleanup-thunk |  |  |  |
> > |  | #:title title |  |  |  |
> > |  | #:abort-label abort-label |  |  |  |
> > |  | #:aborted-message aborted-message]) |  | → |  | void?
> doit : (-> eventspace? (is-a?/c top-level-window<%>) void?)
> cleanup-thunk : (-> void?) = void
> title : string? = "mrlib/terminal"
> | abort-label |  | : |  | string?
> |  |  | = |  | (string-constant plt-installer-abort-installation)
> | aborted-message |  | : |  | string?
> |  |  | = |  | (string-constant plt-installer-aborted)

Creates a dialog, sets up the current error and output ports to print into the dialog’s contents and calls doit in a separate thread under a separate custodian. The exit-handler is set to a function that shuts down the new custodian.

Returns before doit is complete (unless doit completes quickly); cleanup-thunk is called on a queued callback to the eventspace active when with-installer-window is invoked after doit completes.

The title is the dialog of the dialog. In addition to the IO generated by doit, the dialog also contains two buttons, the abort button (with label abort-label) and the close button (with label (string-constant close)). When the abort button is pushed, the newly created custodian is shut down and the aborted-message is printed in the dialog. The close button becomes active when doit returns or when the thread running it is killed (via a custodian shut down, typically).

The value of on-terminal-run is invoked after doit returns, but not if it is aborted or an exception is raised.

> parameter (on-terminal-run) → (-> void?)
> (on-terminal-run run) → void?
> run : (-> void?)

Invoked by in-terminal.
top ← prev up next →