• 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
Using drawRow? Drawing over cells...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using drawRow? Drawing over cells...


  • Subject: Using drawRow? Drawing over cells...
  • From: Oliver Cameron <email@hidden>
  • Date: Tue, 18 Jan 2005 21:46:35 +0000

Hi guys,

I would like to use drawRow: clipRect: in a table view subclass, and have got it working to a certain degree. Just for test purposes I have done this (found from some other code on the list):

- (void)drawRow:(int)row clipRect:(NSRect)frame
{
	if ([self isRowSelected:row])
	{
		NSColor *bgColor = [NSColor blueColor];
		if (bgColor != nil)
		{
			NSRect r = [self rectOfRow:row];
			[bgColor set];
			NSRectFill(NSIntersectionRect(r, frame));
		}
	}
	else
	[super drawRow:row clipRect:frame];
}

This makes the selected row blue, but as a side effect it seems, it draws the blue OVER my table view content, so all I can see is just the blue row and no text or anything in my data source.

Any ideas appreciated,
Oliver

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Implementing KVO in a nested tree of objects
  • Next by Date: AddressBook card view
  • Previous by thread: Window Menu
  • Next by thread: AddressBook card view
  • Index(es):
    • Date
    • Thread