Re: NSOutlineView Row Selection Color
Re: NSOutlineView Row Selection Color
- Subject: Re: NSOutlineView Row Selection Color
- From: Keith Blount <email@hidden>
- Date: Sun, 5 Feb 2006 09:22:18 -0800 (PST)
Hi,
If it's a gradient selection such as the ones in
iTunes, Mail etc that you're after, I posted an
NSOutlineView subclass that will do exactly this on
CocoaDev, here:
http://www.cocoadev.com/index.pl?MailStyleGradientSelection
This takes advantage of Andreas Meyer's very cool
NSBezierPath gradient extensions rather than using an
image to draw the gradient, but if you prefer an image
for a pixel-perfect likeness to the i-Apps gradients,
you should be able to modify the code fairly easily.
It also handles forcing a redraw when the outline view
loses focus so that you can draw the grey gradient
instead of the blue one.
Incidentally, you don't need to call -lockFocus and
-unlockFocus in drawing methods, because they assume
that the focus is already locked on the view (see the
docs for -drawRect: - the other drawing methods are
called from within that). Also, you should be using
"self" rather than "outlineView" from within a
subclass...
Hope that helps,
Keith
--- ORIGINAL MESSAGE ---
Thanks for all your help! However, it is still not
correctly
working. It is getting inside the
_highlightColorForCell method
after I changed the Custom Class of the NSOutlineView
to
LeftMenuController, although now, the text won't
appear. If I click
on a row, nothing happens (however, if I change
_highlightColorForCell to return [NSColor redColor],
when I click the
row it turns red, although there is still no text).
It also goes
inside the highlightSelectionInClipRect, although
nothing occurs
since, even if you click a row, the selectedRow is
always -1 (it is,
however, receiving the outlineViewSelectionDidChange
notification,
although [outlineView selectedRow] always returns -1).
Any help
would be greatly appreciated. Thanks!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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