Re: NSCell drawing
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