Re: Simple question - Subclassing NSView
Re: Simple question - Subclassing NSView
- Subject: Re: Simple question - Subclassing NSView
- From: Mike Abdullah <email@hidden>
- Date: Thu, 12 Jun 2008 11:26:23 -0700
On 12 Jun 2008, at 10:54, Vikas wrote:
O'kay, that was helpful.
I still have one doubt. The declaration of NSRectFill is as below:
void NSRectFill (
NSRect aRect
);
NSRectFill() is a C function, not part of any class e.g. NSView.
aRect is simply a struct which specify location points (doesnt
contain reference of any window). How the function knows about the
drawing surface, in which window/surface to paint? Does it
implicitly make use of some self pointer? If so, then, what if this
function is not called from inside a simple C function then there
will not be any self pointer?
Thank You,
-Vks
As with all Cocoa-based drawing, code knows where it is being drawn
from [NSGraphicsContext currentGraphicsContext]. self is not involved
in any way at all. The point is that you as a developer do not have to
worry about this, all the built-in functions etc. handle it for you.
_______________________________________________
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