Create:
PROC [trc: Trc.
TRC, rectangle: Trc.Rectangle, dx:
REAL, info: ViewerClasses.ViewerRec, proc: Buttons.ButtonProc, clientData:
REF ←
NIL, fork:
BOOL ←
TRUE, paint:
BOOL ←
TRUE]
RETURNS [button: ViewerClasses.Viewer];
Create a trc viewer, but rather than using the Trc.NotifyProc found in trc.class, it will use that for the button class, thereby letting us see icon-sized (e.g.) trc's but have the mouse-clicks do non-standard things.
Note that the button is, in fact, a TrcViewers.Viewer, and therefore TrcViewers can be used to examine and modify the rectangle, dx, and clientData. HOWEVER, TrcViewers.InfoFromTRCViewer[v].trc will not return the initial trc passed in. Instead, use TrcFromButton below.
AttachNewTrcToButton:
PROC [button: ViewerClasses.Viewer, trc: Trc.
TRC, paint:
BOOL ←
TRUE];
Puts a different trc in the button.
TrcFromButton:
PROC [button: ViewerClasses.Viewer]
RETURNS [trc: Trc.
TRC];
The right way to get at the underlying trc, given the button.