This is LineView.m in view mode; [Download] [Up]
// LineView.m
// Part of Risk by Mike Ferris
#import "LineView.h"
#import <dpsclient/psops.h>
@implementation LineView
- setLineWidth:(float)lw
{
lineWidth = lw;
[self display];
return self;
}
- drawSelf:(const NXRect *)rects :(int)rectCount
{
NXCoord mp, begin, end;
NXDrawWhiteBezel(&bounds, NULL);
mp = bounds.origin.y + (bounds.size.height/2);
begin = bounds.origin.x + 2;
end = bounds.origin.x + bounds.size.width - 2;
PSsetgray(NX_BLACK);
PSsetlinewidth(lineWidth);
PSmoveto(begin, mp);
PSlineto(end, mp);
PSclosepath();
PSstroke();
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.