Re: Custom NSView That is iChat Chat Log Like
Re: Custom NSView That is iChat Chat Log Like
- Subject: Re: Custom NSView That is iChat Chat Log Like
- From: Jones Curtis <email@hidden>
- Date: Wed, 28 Feb 2007 00:16:25 -0500
Hopefully this wasn't a poor solution that I ended up using. I
created a custom NSView for the NSScrollView and within that custom
NSView I have an array of custom NSViews that represent each "chat
messages" -- or in my case, data packets -- with hex offset, hex and
ascii data in three columns, along with a background color behind the
hex data to represent the direction the data was traveling (send,
receive).
For the time being, the NSTextField objects that actually draw the
text are allocated when the packet information is received, and
retained until the window is closed. Ultimately, I'm considering
having a pool of them; and the pool would grow to at most the number
of instances necessary to draw the viewable data. As a set of text
fields scroll off the screen and others scroll on, they'd be re-used.
A binary search (or some such) would be used to find the data packet
object that needs to be drawn. Presently, the per-data-packet
NSTextField objects are placed within the larger custom NSView, and
simply left there.
If anyone has any better suggestions (I have not yet implemented the
above-described optimizations), I'd like to hear them.
--
Curtis Jones
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden