• 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: NSImageView only for images?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView only for images?


  • Subject: Re: NSImageView only for images?
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 12 Feb 2005 09:55:36 -0600


On Feb 12, 2005, at 8:34 AM, M. Uli Kusterer wrote:

At 15:18 Uhr +0100 12.02.2005, M. Uli Kusterer wrote:
What seems to work, however, is to create your own NSControl subclass and set its view to one that does whatever you want (e.g. my UKFinderIconCell class that is part of UKDistributedView - NSButtonCell seems to insist on erasing its background, so won't work). Use the following drawRect method:

Ummm... sorry, the current version of UKFinderIconCell will probably not work until you add a -drawInteriorWithFrame:inView: method that calls through to -drawWithFrame:inView:

If you provide an implementation of drawInteriorWithFrame:inView:, you do not want to call drawWithFrame:inView: from it. This is because the latter invokes the former (see the docs).


Here's the rules I'm going by regarding these APIs...

If I need to provide a drawWithFrame:inView:, I always call through to super's drawWithFrame:inView (either before or after my custom code). This will then invoke drawInteriorWithFrame:inView:

If I need to provide a drawInteriorWithFrame:inView: (the most common case from what I've seen), I just do the custom drawing that is needed. I rarely call super's implementation, but it is definitely legal to do so (either before or after the custom drawing).

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSImageView only for images?
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >NSImageView only for images? (From: Joe Maffia <email@hidden>)
 >Re: NSImageView only for images? (From: "M. Uli Kusterer" <email@hidden>)
 >Re: NSImageView only for images? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: A few questions about Memory Management
  • Next by Date: Re: A few questions about Memory Management
  • Previous by thread: Re: NSImageView only for images?
  • Next by thread: Re: NSImageView only for images?
  • Index(es):
    • Date
    • Thread