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

Re: NSCell drawing


  • Subject: Re: NSCell drawing
  • From: Michael Watson <email@hidden>
  • Date: Thu, 15 Feb 2007 12:15:42 -0500

Makes sense. You could:

[[[self controlView] window] isKeyWindow];

But that's an extra message, and adds code. Are there any other situations that could make the controlView parameter of the drawing methods useful?


-- m-s


On 11 Feb, 2007, at 20:46, Alan Smith wrote:

The short answer: Yes.

The long: The controlView is locked before you get a hold of it. The
only reason to even get that object is to determine things like
whether or not the window the cell is being drawn in is key (e.g.
[[controlView window] isKeyWindow]).

So, it's absolutely safe to remove those calls to lock and unlock the
focus. The same goes for NSView and NSControl subclasses, you
shouldn't be locking focus in the drawing methods, that is done for
you.

Good luck and have fun with your new cell.
Peace, Alan


-- // Quotes from yours truly ------------------------- "You don't forget, you just don't remember." "Maturity resides in the mind." "Silence is the Universe's greatest gift." "When the World realizes that religion really is unnecessary, then it shall evolve."

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSCell drawing (From: Michael Watson <email@hidden>)
 >Re: NSCell drawing (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: Knowing if a scroll view is being scrolled
  • Next by Date: [loginwindow] Add a field
  • Previous by thread: Re: NSCell drawing
  • Next by thread: CVS
  • Index(es):
    • Date
    • Thread