• 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: Drawing shadows under views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Drawing shadows under views (From: Jeremy Dronfield <email@hidden>)
 >Re: Drawing shadows under views (From: Vince DeMarco <email@hidden>)
 >Re: Drawing shadows under views (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: TAB NSTextField in a NSView
  • Next by Date: Re: Reading from the "almost end" of a file
  • Previous by thread: Re: Drawing shadows under views
  • Next by thread: NSComboBox and Datasource issue
  • Index(es):
    • Date
    • Thread