Re: NSTableView - Alternating blue and white background
Re: NSTableView - Alternating blue and white background
- Subject: Re: NSTableView - Alternating blue and white background
- From: Cristi Savu <email@hidden>
- Date: Tue, 17 Dec 2002 12:05:13 +0200
Easy,
subclass you NSTableView and use something like this :
Good luck, Cristian
//
// RSTableView.m
// R2003
//
// Created by Cristian Savu on Mon Jul 22 2002.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import "RSTableView.h"
@implementation RSTableView
- (void) drawRow:(int) rowIndex clipRect:(NSRect) clipRect
{
if ((rowIndex % 2 == 0) && ([self selectedRow] != rowIndex))
{
NSColor* bgColor =[NSColor colorWithCalibratedRed:0.97 green: 0.97
blue: 0.97 alpha: 0.97];
NSRect rect= [self rectOfRow: rowIndex];
[bgColor set];
NSRectFill(rect);
}
[super drawRow: rowIndex clipRect: clipRect];
}
@end
On Tuesday, December 17, 2002, at 11:53 AM, Flemming Bengtsson wrote:
I would like to have alternating blue and white background in the rows
of a NSTableView, like in iTunes for example.
How is this done.
Regards
Flemming Bengtsson, FLB Software-udvikling
http://www.flbsoftwareudvikling.dk/
iChat/AOL: email@hidden
Phone: +45 24 82 24 25
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.