Re: Mutable NSColor?
Re: Mutable NSColor?
- Subject: Re: Mutable NSColor?
- From: Ondra Cada <email@hidden>
- Date: Mon, 24 Sep 2001 15:17:55 +0200
Rob,
>
>>>>> Rob Rix (RR) wrote at Mon, 24 Sep 2001 08:29:48 -0400:
RR> >Why don't you just create a new (immutable) color to be used instead the
RR> >old one?
RR>
RR> Err...it would force me to make my API rather hackish. I'd go into more
RR> detail, but I just forgot it.
Come on. I guess that is a reason strong enough to redesign the API.
Or, if the worst came to the worst, what about this (unfinished and
untested) pattern:
@interface NSMutableColour /* ;))) */ : NSColor {
NSColor *colour;
}
-(void)changeSomething:something;
...
// all "normal" methods forwarded to colour
@end
@implementation NSMutableColour
...
-(void)changeSomething:something {
[colour autorelease];
colour=[[NSColor colorWith... colour... and... something...] retain];
}
...
@end
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc