• 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
Subclassing views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassing views


  • Subject: Subclassing views
  • From: Lorenzo <email@hidden>
  • Date: Mon, 03 May 2004 23:33:34 +0200

Hi,
I have just subclassed an NSImageView (MYImageView) because I need some
special behaviour by it. I wrote a lot of code.
Now I realized that I need a class very similar to MYImageView, with some
features more, so I tried to subclass MYImageView, thus I created the class
MYPostit.

In this class I need to see the original image defined in the superclass,
plus a new image which I drag over it. Just like attaching a post-it.
So, in MYPostit I tried to add a subview to self
([self addSubview:postitImageView]), but it didn't work well. I see the
MYImageView image over all, and not the MYPostit over the MYImageView image.

So now I am thinking that the first class MYImageView should have been a
subclass of NSView and not a subclass of NSImageView. So this way, I can add
all the NSImageView I want.

Right? Or, should I use a different solution?


Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re:Subclassing views
      • From: James Chen <email@hidden>
  • Prev by Date: NSOpenPanel Oddity
  • Next by Date: NSView and backgrounds, selectable
  • Previous by thread: Re: NSOpenPanel Oddity
  • Next by thread: Re:Subclassing views
  • Index(es):
    • Date
    • Thread