Re: Drawing an NSView subview myself
Re: Drawing an NSView subview myself
- Subject: Re: Drawing an NSView subview myself
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 10 Sep 2001 15:20:02 -0700
On Monday, September 10, 2001, at 03:00 PM, Chris Rudolph (Rudy) wrote:
Is there any way to handle the drawing of my NSView subviews in my
drawRect call.
Yes. send them a -drawRect: message. They'll draw in the current
graphics context. If you want them to draw in their own graphics
context, then bracket the -drawRect: message with -lockFocus and
-unlockFocus.
I need to composite NSViews with non-NSViews in a multi-layered scheme.
It might help if you described it in a bit more detail. NSViews don't
handle overlapping very well. As currently implemented, if a view
needs to overlay another view, it really should be a subview. I ran
into this when I needed to have a throbbing default button drawn over an
image background. It punched a hole through the image, so it was
surrounded by the window background pinstripes.
Is there any specific, clean way to do this?
I don't know about *clean*, but there's a way to do it, sure. ;-)
-jcr
I almost had a psychic girlfriend, but she left me before we met. --
Steven Wright