Skip navigation.
 
mlRe: Simple question - Subclassing NSView
FROM : Hamish Allan
DATE : Thu Jun 12 20:14:12 2008

On Thu, Jun 12, 2008 at 6:54 PM, Vikas <<email_removed>> wrote:

> 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?


This question is answered in some of the other posts answering your
original question, so hopefully it will now be clear. Essentially, by
the time your overridden version of -[NSView drawRect:] is called, the
drawing subsystem which NSRectFill() uses already knows that your
NSView is the target of the drawing operation.

Hamish

Related mailsAuthorDate
mlSimple question - Subclassing NSView Vikas Jun 12, 19:26
mlRe: Simple question - Subclassing NSView Randall Meadows Jun 12, 19:31
mlRe: Simple question - Subclassing NSView Hamish Allan Jun 12, 19:33
mlRe: Simple question - Subclassing NSView Shawn Erickson Jun 12, 19:36
mlRe: Simple question - Subclassing NSView I. Savant Jun 12, 19:39
mlRe: Simple question - Subclassing NSView Vikas Jun 12, 19:54
mlRe: Simple question - Subclassing NSView Hamish Allan Jun 12, 20:14
mlRe: Simple question - Subclassing NSView I. Savant Jun 12, 20:20
mlRe: Simple question - Subclassing NSView Mike Abdullah Jun 12, 20:26
mlRe: Simple question - Subclassing NSView Kyle Sluder Jun 12, 20:28
mlRe: Simple question - Subclassing NSView Jens Alfke Jun 12, 20:33
mlRe: Simple question - Subclassing NSView Andy Lee Jun 12, 20:45