Questions about NSBitmapImageRep [Follow Up]
Questions about NSBitmapImageRep [Follow Up]
- Subject: Questions about NSBitmapImageRep [Follow Up]
- From: j o a r <email@hidden>
- Date: Sat, 22 Sep 2001 19:18:53 -0700
On Saturday, September 22, 2001, at 06:52 , j o a r wrote:
3) Why do you lock / unlock views at all? I don't have any background
on that and any pointers to documentation on the concepts would be
great. The docks tells you when you should use them, and where in the
code, but not why...
I actually found some answers in the much lamented book Learning Cocoa.
Some snippets about the functionality of lockFocus:
//************************************************************************
*******************
"...it sets up Core Graphics with information about the view, including
graphics context it draws in, the coordinate system and clipping path it
uses, and other graphics state information."
"Making the NSView's window the current graphics context.
Creating a clipping path acound the NSView's frame.
Making the Core Graphics coordinate system match the NSView's coordinate
system"
"If you define some methods that need to draw in a view without going
thriough the display... methods, you must send lockFocus to the view
that you're drawing in"
"Only one NSView can have focus at a time"
//************************************************************************
*******************
Is there anything to add besides this?
Thanx,
j o a r