| Sign In/My Account | View Cart |
| Article: |
Building a Scratch Pad with Cocoa | |
| Subject: | NSBezier subclass creation set with no get accessor | |
| Date: | 2001-12-09 07:06:48 | |
| From: | psheldon | |
|
Response to: NSBezier subclass for ColoredPath
|
||
|
I would make a method to create a ColorPath with an NSColor value which would assign an internal NSColor value and retain it within the object instantiation initialization which would also perform the inherited function. Then, I would override the stroke function to include the NSColor set for the current environment. I am not clear with the "fuzzy typing" whether I could make a subclass of ColorPath be ColorPaths because of my narrow focus on the methods of NSBezierclass. Apple didn't do this in sketch, so I think it would be too much of a stretch for me to try to do. |
||
Showing messages 1 through 2 of 2.
+ (ColorBezier*)initWithColor:(NSColor*)color {
self = [[super bezierPath] retain];
if (self) {
theColor = color;
}
return self;
}