Subclassing views
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.