SwapQueuedButtonProcs:
PUBLIC
PROC[buttonName: Rope.
ROPE, miscreant: Buttons.ButtonProc]
RETURNS[realProc: Buttons.ButtonProc←NIL] = {
button: Buttons.Button = ViewerOps.FindViewer[buttonName];
buttonData: ButtonsImpl.ButtonData;
clickInfo: MBQueueImpl.MyClickInfo;
IF button=NIL THEN RETURN;
buttonData ← NARROW[button.data];
IF buttonData=NIL THEN RETURN;
clickInfo ← NARROW[buttonData.clientData];
IF clickInfo=NIL THEN RETURN;
realProc𡤌lickInfo.proc;
clickInfo.proc ← miscreant;
};
}.