Re: NSImageView and custom cells....
Re: NSImageView and custom cells....
- Subject: Re: NSImageView and custom cells....
- From: Teunis Peters <email@hidden>
- Date: Thu, 26 May 2005 10:49:56 -0700
On May 26, 2005, at 9:34 AM, John C. Randolph wrote:
You're probably running into the classic problem of unarchiving custom controls from nib files. If you're creating your custom Image view by setting the "custom class" attribute in IB, then when the nib file is read, you'll get an instance of your WGDBImageView, but the cell it contains will be a plain old image cell.
To correct this, implement -awakeFromNib in your WGDBImageView class, and replace the cell with a new WGDBImageCell.
this did NOT work.
However - calling
- (void)windowDidLoad {
[super windowDidLoad];
...
[icon setCell:[[WGDBImageCell alloc] init]];
....
}
from the NSWindowController derivative did work for replacing cell type. Only problem is location of image has been lost (???)
I'm officially giving up and writing a custom control at this time - this is far too weird and inconsistent. I've been avoiding it but NSMatrix also doesn't do what I need (I'd like to be able to dynamically fit a list of items into whatever space is available, and scroll as needed after), so I'll just make sure the case of only one item present works too.
I'd still like to find out why this fails but am no longer in a rush.
_______________________________________________
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