<> <> <> DIRECTORY Buttons, Idle, Menus, SystemVersion, ViewerClasses, ViewerIdle, ViewerOps; ViewerIdleImpl: CEDAR MONITOR IMPORTS Buttons, Idle, SystemVersion, ViewerOps EXPORTS ViewerIdle = { GetIdleProc: PUBLIC ENTRY PROC RETURNS [proc: Buttons.ButtonProc, clientData: REF ANY] = {proc _ idleProc; clientData _ idleData}; SetIdleProc: PUBLIC ENTRY PROC [proc: Buttons.ButtonProc, clientData: REF ANY _ NIL] RETURNS [oldProc: Buttons.ButtonProc, oldClientData: REF ANY] = { oldProc _ idleProc; oldClientData _ idleData; idleProc _ proc; idleData _ clientData; }; idleProc: Buttons.ButtonProc _ CallSleep; idleData: REF ANY _ NIL; CallSleep: Buttons.ButtonProc = {Idle.Sleep[]}; IdleProc: PROC [parent: REF ANY, clientData: REF ANY _ NIL, mouseButton: Menus.MouseButton _ red, shift, control: BOOL _ FALSE] --Buttons.ButtonProc-- = { idleProc[ parent: parent, clientData: idleData, mouseButton: mouseButton, shift: shift, control: control]; RefreshIfNecessary[]; }; useIdleCrock: BOOL _ TRUE; -- can be set to FALSE to provoke the bug RefreshIfNecessary: PROC = { IF useIdleCrock AND SystemVersion.machineType = dandelion THEN <> <> ViewerOps.PaintEverything[]; }; idleViewer: ViewerClasses.Viewer; Start: PROC = { idleViewer _ Buttons.Create[info: [name: "Idle"], proc: IdleProc, fork: TRUE]; }; Start[]; }.