• 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
Some seemingly odd NSBezierPath behavior.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some seemingly odd NSBezierPath behavior.


  • Subject: Some seemingly odd NSBezierPath behavior.
  • From: Cory Knapp <email@hidden>
  • Date: Mon, 15 Sep 2003 02:03:38 -0700

I have a chunk of code that generates a NSBezierPath, and this code works fine when I call it in my view's drawRect: method. However, if I try to build the path in the init method, it gives me an empty NSBezierPath. Here is a trimed down example of what I am talking about:

- (id)initWithFrame:(NSRect)frameRect
{
if( self = [super initWithFrame:frameRect])
{
int i, length = [label length];
int vert = 0;

//NSAffineTransform *transform;
titlePath = [[NSBezierPath alloc] init];
for( i = 0; i<length ; i++)
{
NSGlyph theGlyph = [titleFont _defaultGlyphForChar:[label characterAtIndex:i]];
[titlePath moveToPoint: NSMakePoint(vert,0)];
[titlePath appendBezierPathWithGlyph:theGlyph inFont: titleFont];
vert += [titleFont advancementForGlyph:theGlyph].width;
}
}

return self;
}

- (void)drawRect:(NSRect)rect
{
[[NSColor blackColor] set];
[titlePath fill];
}

Any ideas?
_______________________________________________
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.

  • Follow-Ups:
    • Re: Some seemingly odd NSBezierPath behavior.
      • From: j o a r <email@hidden>
  • Prev by Date: Re: NSOutlineView's setIndentationMarkerFollowsCell
  • Next by Date: Re: Lots o' Formatters
  • Previous by thread: Re: Disabling a button in a matrix
  • Next by thread: Re: Some seemingly odd NSBezierPath behavior.
  • Index(es):
    • Date
    • Thread