• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBezierPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Re: What do you think of NSController?
  • Next by Date: Re: MutableArrays losing its contents?
  • Previous by thread: Drawing in 3D with Cocoa views
  • Next by thread: Re: MutableArrays losing its contents?
  • Index(es):
    • Date
    • Thread