ButtonDataRec:
TYPE =
RECORD [
lock: CARDINAL,
proc: Buttons.ButtonProc,
font: LONG CARDINAL,
clientData: LONG POINTER TO MyClickInfoObj
];
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;
};
};
}.