UncleanImpl.mesa
Last Edited by: Swinehart, March 11, 1985 9:45:17 am PST
DIRECTORY Buttons, Rope, Unclean, ViewerOps;
UncleanImpl: CEDAR PROGRAM
IMPORTS ViewerOps
EXPORTS Unclean = {
ButtonDataRec: TYPE = RECORD [
lock: CARDINAL,
proc: Buttons.ButtonProc,
font: LONG CARDINAL,
clientData: LONG POINTER TO MyClickInfoObj
];
MyClickInfoObj: TYPE = RECORD [
proc: Buttons.ButtonProc
];
SwapQueuedButtonProcs: PUBLIC PROC[buttonName: Rope.ROPE, miscreant: Buttons.ButtonProc]
RETURNS[realProc: Buttons.ButtonProc←NIL] = TRUSTED {
button: Buttons.Button = ViewerOps.FindViewer[buttonName];
buttonData: LONG POINTER TO ButtonDataRec;
clickInfo: LONG POINTER TO MyClickInfoObj;
IF button=NIL THEN RETURN;
buttonData ← LOOPHOLE[button.data];
IF buttonData=NIL THEN RETURN;
clickInfo ← buttonData.clientData;
IF clickInfo=NIL THEN {
realProc ← buttonData.proc;
buttonData.proc ← miscreant;
}
ELSE {
realProc𡤌lickInfo.proc;
clickInfo.proc ← miscreant;
};
};
}.