Re: NSTextFieldCell Subclass for Image+Text, any faster way?
Re: NSTextFieldCell Subclass for Image+Text, any faster way?
- Subject: Re: NSTextFieldCell Subclass for Image+Text, any faster way?
- From: PGM <email@hidden>
- Date: Mon, 20 Nov 2006 23:07:59 -0500
One solution could be to package the image together with the text
into an attributedString (see also NSTextAttachment) and give that as
a returnvalue for tableView:objectValueForTableColumn:row:. I have
not tried it to see how fast it is, but it may be faster than your
subclasses.
Cheers, Patrick
On 20-Nov-06, at 22:49 PM, Brian Amerige wrote:
Hi all,
I've been playing with a whole lot of subclasses which all do
essentially the same thing, in the same way. They're subclasses of
NSTextFieldCell, one even from Apple named ImageAndTextCell, and
they all work nicely, with the exception of one thing: speed!
They're quite fine for simple things like TableView's with say, 5
items, but seriously, once I pass 20 or so items, actions are
painful in regard to the subclass! This makes sense to me because
it's actually redrawing the cell every-time you, say resize the
window, scroll, highlight all, etc.
My question is: Is it possible to have do draw an image (16x16) in
the same cell as text, without it being a total resource hog, and
reasonable for usage in real-world scenarios?
If not, I've experimented with placing the image in a separate
column, which was far better performance wise, but was unsightly
because of the header divider. In this case, can I "hide" the
header divider?
Thanks,
Brian Amerige.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40sympatico.ca
This email sent to 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