FeedbackDoc.tioga
Bier, September 1, 1989 11:00:22 am PDT
Last tweaked by Mike Spreitzer on May 3, 1990 11:10:01 am PDT
Feedback
CEDAR 7.0 — FOR INTERNAL XEROX USE ONLY
Feedback
Redirectable, Delayable, Print Statements
Eric Bier
© Copyright 1989 Xerox Corporation. All rights reserved.
Abstract: This is a package that you will want to use instead of directly using MessageWindow or Typescripts when you want to communicate a line of text to the user. The SimpleFeedback interface provides output capability to clients that don't need to worry about where it goes; the Feedback interface is for clients that also want to direct where their output goes. Feedback.PutF uses all of the formatting power of IO.PutF, and sends your message to a lightweight data structure, called a MsgRouter. Using another interface, FeedbackOps.mesa (in FeedbackOps.df), you can wire up the MsgRouter to send its output to the MessageWindow, a Typescript, a Labels.Label, an IO.STREAM, or some combination of these. The MsgRouter can be configured to send some messages (e.g., error messages) to one place or places, while sending other messages (e.g., informational messages) to another place or places. Finally, the MsgRouter will store messages for later display. Thus, it is possible to use SimpleFeedback.mesa in the startup code for the Viewers package, and display warning messages once Viewers is finished initializing.
Created by: Eric Bier
Maintained by: Eric <Bier.pa>
Keywords: Print Statements, routing, MsgRouter, feedback, MessageWindow, Typescript
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
0. Before You Proceed
Also, this release of Feedback produces an interface conflict with the existing Feedback.mesa in AtomButtons. So you also want to wait until the new AtomButtons.df is released. The new AtomButtons.df will not contain Feedback.mesa.
1. Using Feedback
Getting Started
To get started using Feedback, you can call Feedback.CreateRouter[] to create a router. Pass this router to Feedback.Append or Feedback.PutF, when you send your output.
The msgType argument of Append and PutF tells Feedback when adding carriage returns will be useful in typescripts, and when clearing the MessageWindow or Labels.Label is a good idea.
The msgClass argument of Append and PutF is your way of identifing the type of a message. Do you think of it as an $Error message, a $Debug message, a $DuringMouse message. By providing this argument, you make it possible to direct one class of messages to one output place, while directing another class of messages to a different output place.
Wiring up your MsgRouter
Use the FeedbackOps interface, or Feedback.SetHandler, to wire up various message classes of a given MsgRouter to various output streams (some of which can be found in FeedbackClasses).