Re: NSOutlineView, NSBrowserCell and Images
Re: NSOutlineView, NSBrowserCell and Images
- Subject: Re: NSOutlineView, NSBrowserCell and Images
- From: John Randolph <email@hidden>
- Date: Wed, 26 May 2004 12:04:44 -0700
Brian,
NSOutlineView, like NSTableView, has exactly one cell per column, which
is re-used to draw each row. Why did you choose NSBrowserCell for
this?
-jcr
On May 26, 2004, at 9:18 AM, Brian Bergstrand wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I posted this on Mac OS X Dev a few days ago, and received no response.
Can anyone here help?
Thanks.
Begin forwarded message:
Hi all,
I have an Outline view that uses NSBrowserCell as the cell prototype.
I
have one problem with this, it seems as though the outline view is
sharing a single cell -- at least for the image portion of the cell.
All of my entries end up sharing the same icon, when they should have
different icons. The entry names as correct (ie not shared), but the
icons are not.
I set the table up as follows in my init method:
[[outline tableColumnWithIdentifier:@"col1"]
setDataCell:[[[NSBrowserCell alloc] init] autorelease]];
And then in the willDisplayCell delegate method, I set the icon for
each item.
- - (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
// determine correct icon
[cell setImage:icon];
//
}
This works the first time through, but as soon as the view needs to
redraw items, all cells change to the icon of the very last cell set.
Anyone have any ideas?
Thanks.
Brian Bergstrand <http://www.bergstrand.org/brian/>, AIM: triryche206
PGP Key: <http://www.bergstrand.org/brian/misc/public_key.txt>
Like ex-Pres Clinton, Microsoft has a teflon coating. Fascinating, and
disturbing. - IronChef (no not THE Iron Chef)
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3
iQA/AwUBQLS1UnnR2Fu2x7aiEQJitACeMXnEG48eaBrgLKSTxMo35OtjLf4An10L
tOhGPdY9EhhRycLlxFTsr2Zl
=6ovl
-----END PGP SIGNATURE-----
_______________________________________________
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.
_______________________________________________
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.