On 14.05.2008, at 15:32, Davide Scheriani wrote:

I was playing around with the Graphics drawing method
and I wanted to use NSRectFillListWithColors.
.....
My small problem is that it accept C-style arrays not NSArray.
What can I do?

Do exactly what the description of this function says;

void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)

I used this function to draw the colortables of GIF, PNG or BMP- imgaes and it looks something like:

    NSRect    rectList[256];  // long enough for a color table
    NSColor   *colorList[256];

    rectList[0] = NSMakeRect( 0,  0, 26, 16 );  // is it flipped ?
    rectList[1] = NSMakeRect( 32,  0, 26, 16 );
    rectList[2] = NSMakeRect( 64,  0, 26, 16 );

    colorList[0] = [NSColor blackColor];
    colorList[1] = [NSColor whiteColor];
    colorList[2] = [NSColor redColor];

    NSRectFillListWithColors( rectList, colorList, 3 );

Good luck
        Heinrich


--
Heinrich Giesen
[EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to