On this page:
in-terminal
on-terminal-run

17 Terminal Window

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.