FeedbackInitialViewersImpl.Mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on May 7, 1990 3:24 pm PDT
DIRECTORY Atom, Feedback, FeedbackClasses, FeedbackOps, ViewerOps;
FeedbackInitialViewersImpl:
CEDAR
PROGRAM
IMPORTS Atom, Feedback, FeedbackClasses, FeedbackOps, ViewerOps
=
BEGIN
sysScriptName: Feedback.ROPE ~ "SystemScript";
sysScriptAtom: ATOM ~ Atom.MakeAtom[sysScriptName];
Start:
PROC ~ {
ts: FeedbackOps.Viewer ~ FeedbackOps.CreateNamedTypescript[headerText: sysScriptName, typescriptName: sysScriptAtom, storing: TRUE].typescript;
new: Feedback.MsgHandler ~ FeedbackOps.CreateViewersHandler[sysScriptAtom, FeedbackOps.messageWindow, FALSE];
old: Feedback.MsgHandler ~ Feedback.SetGlobalDefaultHandlersBehavior[new];
IF ts#NIL THEN ViewerOps.CloseViewer[ts];
IF old=NIL THEN RETURN;
{h1, h2: Feedback.MsgHandler;
isSplitter, y: BOOL;
Try:
PROC [mh: Feedback.MsgHandler]
RETURNS [found:
BOOL] ~ {
[found] ¬ FeedbackClasses.IsStoringHandler[mh];
IF found THEN FeedbackClasses.PlayStore[mh, new, $History, TRUE];
RETURN};
[isSplitter, h1, h2] ¬ FeedbackClasses.IsSplittingHandler[old];
y ¬ IF isSplitter THEN Try[h1] OR Try[h2] ELSE Try[old];
RETURN}};
Start[];
END.