NSBezierPath
NSBezierPath
- Subject: NSBezierPath
- From: Daniel Todd Currie <email@hidden>
- Date: Sun, 30 Nov 2003 21:42:05 -0800
I'm trying to draw an NSBezierPath; I've looked over and borrowed code
from the Clock Control.app example, but I can find no other examples,
and the Clock Control example covers everything that I would like to
do.
Anyway, the following code isn't working (at all). This is currently
just a test method that should simply draw a line from the bottom left
corner to the top right corner. gaugeView is declared in my .h file
and is linked to an NSQuickDrawView in IB. I have verified that the
output of the NSLog is appropriate. Any help would be appreciated;
TIA!
- (void)drawNeedleForError:(NSNumber *)percentError
{
if(!percentError) { return; }
NSPoint needleBase, needleTip;
NSRect gaugeRect;
gaugeRect = [gaugeView frame];
NSLog(@"gaugeRect: %f, %f, %f, %f", gaugeRect.origin.x,
gaugeRect.origin.y, gaugeRect.size.width, gaugeRect.size.height);
needleBase = NSMakePoint(gaugeRect.origin.x, gaugeRect.origin.y);
needleTip = NSMakePoint(gaugeRect.origin.x + gaugeRect.size.width,
gaugeRect.origin.y + gaugeRect.size.height);
[[NSColor redColor] set];
[NSBezierPath setDefaultLineWidth:2.0];
[NSBezierPath strokeLineFromPoint:needleBase toPoint:needleTip];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.