• 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
Trouble drawing a polygon...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trouble drawing a polygon...


  • Subject: Trouble drawing a polygon...
  • From: "Brian O'Brien" <email@hidden>
  • Date: Tue, 26 Apr 2005 14:29:05 -0600

My first polygon! :)
But nothing is drawing....


NSPoint p; int i;

NSBezier * path = [NSBezierPath alloc] init];
[path setLineWidth:1.0];

// draw first set of points. green
for (i=0; i < npoints; ++i)
{
	p = [self getAPoint:i];
	[path lineToPoint:p];
}
[path closePath];
[[NSColor greenColor] set];
[path stroke];

// draw second set of points. red
for (i=0; i < npoints; ++i)
{
	p = [self getBPoint:i];
	[path lineToPoint:p];
}
[path closePath];
[[NSColor redColor] set];
[path stroke];

[path dealloc];


nothing displays... this is done in my drawrect function... Have I misunderstood something?

What is the difference between this and say appendBezierPathWithPoints?
How do you add one point at a time with the append method?
It seems to want a pointer to a point array...

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Trouble drawing a polygon...
      • From: Shawn Erickson <email@hidden>
    • Re: Trouble drawing a polygon...
      • From: "Brian O'Brien" <email@hidden>
  • Prev by Date: Re: Subclassing Catch-22
  • Next by Date: Re: Subclassing Catch-22
  • Previous by thread: Erratic behaviour in mouseDown: method of NSTableView
  • Next by thread: Re: Trouble drawing a polygon...
  • Index(es):
    • Date
    • Thread