FROM : Ian G. Gillespie
DATE : Tue Jan 28 21:14:35 2003
Thanks a lot Matt!
I really appreciate it.
(I appreciate everyone else comments and help too)
~Ian
On Tuesday, January 28, 2003, at 11:57 AM, Matt Gemmell wrote:
> On Tuesday, January 28, 2003, at 05:11 pm, Ian G. Gillespie wrote:
>
>> Excuse my ignorance (I am still learning, that is for sure), but how
>> do I add a method to the NSBezierPath "category"?
>
> Hi Ian,
>
> A "category" is a way to add methods to an existing class. He's
> suggesting that you create a category on NSBezierPath (i.e. create a
> category which adds a method to NSBezierPath). The enclosed files
> should work. Just add them to your project, and put this line at the
> top of any file you'll be calling the method from:
>
> #import "NSBezierPath+YourExtensions.h"
>
> and then you can call the method like this:
>
> [NSBezierPath drawGradientInRect:yourRect
> startColor:[NSColor yellowColor]
> endColor:[NSColor greenColor]];
>
> Note: I haven't checked to see whether the method does what it says it
> does, but the above is indeed how to add a category to an existing
> class.
>
> Cheers,
> -Matt
> <NSBezierPath+YourExtensions.h><NSBezierPath+YourExtensions.m>
> --
> Matt Gemmell
> Scotland Software
> http://www.scotlandsoftware.com/
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Jan 28 21:14:35 2003
Thanks a lot Matt!
I really appreciate it.
(I appreciate everyone else comments and help too)
~Ian
On Tuesday, January 28, 2003, at 11:57 AM, Matt Gemmell wrote:
> On Tuesday, January 28, 2003, at 05:11 pm, Ian G. Gillespie wrote:
>
>> Excuse my ignorance (I am still learning, that is for sure), but how
>> do I add a method to the NSBezierPath "category"?
>
> Hi Ian,
>
> A "category" is a way to add methods to an existing class. He's
> suggesting that you create a category on NSBezierPath (i.e. create a
> category which adds a method to NSBezierPath). The enclosed files
> should work. Just add them to your project, and put this line at the
> top of any file you'll be calling the method from:
>
> #import "NSBezierPath+YourExtensions.h"
>
> and then you can call the method like this:
>
> [NSBezierPath drawGradientInRect:yourRect
> startColor:[NSColor yellowColor]
> endColor:[NSColor greenColor]];
>
> Note: I haven't checked to see whether the method does what it says it
> does, but the above is indeed how to add a category to an existing
> class.
>
> Cheers,
> -Matt
> <NSBezierPath+YourExtensions.h><NSBezierPath+YourExtensions.m>
> --
> Matt Gemmell
> Scotland Software
> http://www.scotlandsoftware.com/
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Ian G. Gillespie | Jan 28, 03:52 | |
| Matt Gemmell | Jan 28, 04:26 | |
| Joseph Jones | Jan 28, 04:42 | |
| Christopher Hollan… | Jan 28, 10:33 | |
| Brock Brandenberg | Jan 28, 15:27 | |
| Ian G. Gillespie | Jan 28, 18:11 | |
| Joseph Jones | Jan 28, 19:47 | |
| Erik M. Buck | Jan 28, 20:04 | |
| Erik M. Buck | Jan 28, 20:51 | |
| Ian G. Gillespie | Jan 28, 21:14 | |
| John C. Randolph | Jan 28, 21:58 | |
| Ian G. Gillespie | Jan 28, 23:17 | |
| Matt Gemmell | Jan 29, 03:01 | |
| Christopher Hollan… | Jan 29, 04:19 |






Cocoa mail archive

