• 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 highlited text color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView highlited text color


  • Subject: Re: NSTableView highlited text color
  • From: Andre Masse <email@hidden>
  • Date: Thu, 06 Nov 2008 08:17:55 -0500

Thanks for the idea,

Andre Masse


On Nov 5, 2008, at 21:38, Dave Fernandes wrote:

As yet another way to do this, you can subclass the NSTableView and override drawRow: clipRect:

Here's my code to give a background color to expandable rows in an outline view (like in Mail.app).


// Override to draw expandable rows with background color.
- (void)drawRow:(int)rowIndex clipRect:(NSRect)clipRect
{
id item = [self itemAtRow:rowIndex];

if ([self isExpandable:item] && [self selectedRow] != [self rowForItem:item])
{
NSRect cellRect = [self rectOfRow:rowIndex];
[[NSColor colorWithCalibratedHue:216./360. saturation:0.16 brightness:0.95 alpha:1.] set];
[NSBezierPath fillRect:cellRect];

[[NSColor gridColor] set];
NSBezierPath* outline = [NSBezierPath bezierPath];
NSPoint point = NSMakePoint(cellRect.origin.x, cellRect.origin.y);
[outline moveToPoint:point];
point.x += cellRect.size.width;
[outline lineToPoint:point];
[outline setLineWidth:1.];
[outline stroke];
}

[super drawRow:rowIndex clipRect:clipRect];
}

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSTableView highlited text color (From: Andre Masse <email@hidden>)
 >Re: NSTableView highlited text color (From: Dave Fernandes <email@hidden>)

  • Prev by Date: Re: Two-way connection with NSConnection
  • Next by Date: Re: NSTimer issue
  • Previous by thread: Re: NSTableView highlited text color
  • Next by thread: Getting square corners of UITableView grouped style???
  • Index(es):
    • Date
    • Thread