[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Window and Standard I/O Stream

    Date: Thu, 30 Jul 87 09:54:05 JST
    From: Hideyuki Nakashima <nakashim%etl.jp at RELAY.CS.NET>

    When I create a new window (tv:window) with its own process
    (tv:process-mixin) in Genera 7.1, the standard I/O stream
    (*standard-input/output*, *terminal-io*) of the process seems to be
    bound to the BACKGROUND stream, not the window itself.

The function you supply (the car of the :process init-option) is
called with one argument, the window.

So if your window is an ordinary window with process-mixin mixed in
you might want to do something like this:

(defflavor nakashima-window () tv:(window process-mixin)
  (:default-init-plist :process '(nakashima-top-level)))

(defun Nakashima-top-level (window)
  (let ((*terminal-io* window))
    ...do more stuff...))

Now if you actually had a frame (a more common occurrance), you'd do
something like this:

(defflavor nakashima-frame ()
         tv:(bordered-constraint-frame-with-shared-io-buffer process-mixin)
  (:default-init-plist :process '(nakashima-top-level)
		       :selected-pane 'interactor
		       :panes `((interactor <interactor-flavor>)
				...more panes here...)))

(defun Nakashima-top-level (frame)
  (let ((*terminal-io* (send frame :get-pane 'interactor)))
    ...do more stuff...))

Now that there are generic functions I prefer to make the top-level be
a generic function of the frame since you sometimes want to initialize
various things here which for one reason or another you don't want in
an :after :init method.

Execept in very rare cases you want to bind *terminal-io* rather than
*standard-input* and -output* in these to-level functions, so that
something reasonable happens when something (like the debugger)
unequivocally wants to communicate with the user.

I don't think any of this is documented anywhere.