• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom NSView That is iChat Chat Log Like
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:50:09 -0500

On Feb 28, 2007, at 00.39.11, I. Savant wrote:

... really, (my previous message notwithstanding), I don't see why this can't be done with a simple table view. You can use one of many different methods (such as setting an NSTextField cell's background color in the - tableView:willDisplayCell:forTableColumn:row: NSTable delegate method, for example) to color the background of each item depending on their 'sending direction'.

My first objection to using tables - and maybe there is a reasonable way around this - was the lack of support for variable-height rows. Someone pointed out a 3rd-party open source class that accomplishes this. I wasn't interested in having this product dependent on that - at least not right now.


So, assuming that forever-and-always I would only be interested in displaying text, and only having cell-sized background colors, and never anything out-of-line with the columns, I could potentially split the incoming data up so that it fit within a series of single lines. This has a lot of down-sides. Although it would probably work, if I was willing to make those concessions.

As it is, I believe that the visual depiction of the packets will probably end up having more ... frills.


This would be ****FAR**** more efficient and ****WAY**** easier than a slew of NSViews (or trying to reuse a few views to represent a large list for that matter).

That's the issue about which I was most concerned, and also where I'm completely ignorant. Far more efficient? You're sure of this? I expect that prior to doing my memory-related optimizations, that placing the per-packet NSViews within the overall NSView and leaving them there was rather CPU efficient - while not terribly memory efficient. Whereas with an NSTableView, there are many, many calls back to the data source to get the necessary data, set up the data cell, and re-draw it.


If you can speak somewhat authoritatively on the efficiency of an NSTableView and data source, as opposed to a big NSView with a bunch of subviews ... I'd like to hear more about it.

With regards to the "easy" aspect - I'm not even kind of worried about that. "Easy" is writing code in Cocoa. "Hard" is working on the kernel extension. I actually prefer the latter. Anyway, the hard party (getting the NSView in place with its subviews and all that) is done and working well. It took a long time to come up with the solution, and a few hours to actually write it. I'm definitely more interested in hearing about efficiency/scalability (memory & cpu). I need to see what happens when I have 20MBs+ of data in it, for instance.


-- 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

References: 
 >Custom NSView That is iChat Chat Log Like (From: Jones Curtis <email@hidden>)
 >Re: Custom NSView That is iChat Chat Log Like (From: Andreas Mayer <email@hidden>)
 >Re: Custom NSView That is iChat Chat Log Like (From: Jones Curtis <email@hidden>)
 >Re: Custom NSView That is iChat Chat Log Like (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Custom NSView That is iChat Chat Log Like
  • Next by Date: Re: Frustration trying to get NSConnection/NSPort working (feels like it should be simpler ...)
  • Previous by thread: Re: Custom NSView That is iChat Chat Log Like
  • Next by thread: Re: Custom NSView That is iChat Chat Log Like
  • Index(es):
    • Date
    • Thread