Setting a custom NSImageCell
Setting a custom NSImageCell
- Subject: Setting a custom NSImageCell
- From: Jim Turner <email@hidden>
- Date: Mon, 17 Apr 2006 09:30:09 -0500
- Thread-topic: Setting a custom NSImageCell
I'm confused, please help...
I have a custom view with a subclass of NSImageView assigned to it. I load
images into it that I read from a database. The process works like a champ.
I can then drag said image from this view into Photoshop et al and diddle
it.
The problem I have is in composing the drag image when the source image is
larger than the view. I'd like to know the size of the scaled image
contained in my view and build my drag image to that size (so it doesn't
fill the entire screen, like some of my images tend to do). NSImageCell
knows this value, but "/*All instance variables are private*/", according to
the header file.
So I subclass NSImageCell in IB and create a method to return this value. I
then do this in my NSImageView subclass (which, according to the
documentation, seemed like the right thing to do):
- (void) awakeFromNib
{
[self setCellClass:[JTImageCell class]];
}
But what I'm getting when I compile this is that JTImageView may not respond
to -setCellClass. Why is this? If I inherit from NSImageView, which
inherits from NSControl, shouldn't I get access to -setCellClass? Or do I
need to implement a setCellClass in my JTImageView that does this since I'm
working with a custom NSImageView?
As always, I appreciate any ideas. Thank you.
--
Jim Turner
email@hidden
_______________________________________________
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