• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing an NSView subview myself
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Drawing an NSView subview myself (From: Chris Rudolph (Rudy) <email@hidden>)

  • Prev by Date: Re: Mac OS X 10.1 File Name Extension Guidelines
  • Next by Date: RE: Would Any Developers Use This?
  • Previous by thread: Drawing an NSView subview myself
  • Next by thread: Simple File Transfer
  • Index(es):
    • Date
    • Thread