• 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: NSCell bezel drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell bezel drawing


  • Subject: Re: NSCell bezel drawing
  • From: glenn andreas <email@hidden>
  • Date: Thu, 5 Jul 2007 20:28:39 -0500


On Jul 5, 2007, at 7:52 PM, Keith Duncan wrote:

What is the best way to draw a rounded bezel like the one NSSearchFieldCell draws. I'm aware of the private NSTextFieldCell method that draws it in this case but I need to replicate it without subclassing NSTextFieldCell.

I've looked at the functions in NSGraphics more specifically NSDrawTiledRects which would seem to work in for a rectangular bezel but I need a rounded bezel. So I considered clipping the path to a rounded rectangular bezier path but the shadow understandably wasn't drawn at the edge of the clipping path.

- Keith

Nothing prevents you from creating an NSSearchFieldCell and telling it to draw its frame in a specified rectangle that you provide (you can even use it to calculate where the "inside" is for putting your content) - basically acting like anything else that holds a cell (like a matrix, or table column).


Of course, if something looks like a search field, you might as well actually use a search field (since if it looks like a search field, it should behave like one, and at that point, you've basically got a search field).


Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! Cardographer | the custom playing card designer


_______________________________________________

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


  • Follow-Ups:
    • Re: NSCell bezel drawing
      • From: Keith Duncan <email@hidden>
References: 
 >NSCell bezel drawing (From: Keith Duncan <email@hidden>)

  • Prev by Date: Re: Custom NSMenuItems on the fly?
  • Next by Date: Re: NSCell bezel drawing
  • Previous by thread: Re: NSCell bezel drawing
  • Next by thread: Re: NSCell bezel drawing
  • Index(es):
    • Date
    • Thread