-3

I want my drawRect function,

-(void)drawRect{
    NSBezierPath * path = [NSBezierPath bezierPath];
    [path setLineWidth:4];
    NSPoint center = {ycord,xcord};
    [path moveToPoint: center];
    [path appendBezierPathWithArcWithCenter:center 
                                     radius:plyr_size 
                                 startAngle:0 
                                   endAngle:360]; 
    [[NSColor blackColor] set];
    [path fill];
    [[NSColor blackColor] set];
    [path stroke];
}

to be inside a subclass of NSView, without adding another @implementation and @interface. This is to achieve clipping. Alternatively, are there any other options for clipping? If you tell me "NSBezierPath's drawclip" then you have to explain yourself.

evdude100
  • 437
  • 4
  • 18
  • 2
    It's very unclear what you want and what you're trying to achieve. – Nikolai Ruhe May 19 '11 at 13:29
  • No, you didn't. You say, that you want an unspecified subclass of `NSView` to contain some method but you do not want to implement this class. That's not clear to me. Do you want code inside a `drawRect:` implementation of yours to clip what it's drawing? Or is your question about an existing (framework) class which you cannot change and you want the contents of this view to be clipped? – Nikolai Ruhe May 19 '11 at 13:56
  • I want to have a rectangular area that will clip anything out side of the boundries. – evdude100 May 19 '11 at 14:00
  • 2
    Berating people who try to help you is not a good approach to take. Niklolai was quite right when he said it wasn't very clear what you want to do "adding another @implementation..." etc. Instead of turning on caps, I suggest you ask you question in a clearer fashion. – Simon Lee May 19 '11 at 14:59

1 Answers1

1
[NSBezierPath clipRect:myClipRect];
Nikolai Ruhe
  • 81,520
  • 17
  • 180
  • 200