Re: Drawing shadows under views
Re: Drawing shadows under views
- Subject: Re: Drawing shadows under views
- From: Vince DeMarco <email@hidden>
- Date: Tue, 17 Feb 2004 14:01:20 -0800
On Feb 17, 2004, at 10:59 AM, Jeremy Dronfield wrote:
On 17 Feb 2004, at 5:41 pm, Vince DeMarco wrote:
Address Book doesn't now draw underneath the view. In Address Book
there is a subclass of NSTextView that draws on the shadow around the
selection.
How does that work? Wouldn't it just apply a shadow to the selected
text?
Actually there is no support in the Text System to do this. What we did
is we over ride drawRect: and in the draw rect, we call super, then
find the selected range of text, figure out where it is, and draw a
shadowed box around the text.
Draw a box off screen in an NSImage, with a shadow, punch a hole to fit
the text in this off screen NSImage, then composite this NSImage on top
of the NSTextView at the right spot.
vince
-Jeremy
========================================
email@hidden
theLocustFarm.net:
- fractious fiction at http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.