• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView - Alternating blue and white background
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSTableView - Alternating blue and white background
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: NSTableView - Alternating blue and white background
  • Next by Date: Re: NSTableView - Alternating blue and white background
  • Previous by thread: Re: NSTableView - Alternating blue and white background
  • Next by thread: Re: NSTableView - Alternating blue and white background
  • Index(es):
    • Date
    • Thread