• 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: Wain <email@hidden>
  • Date: Sat, 24 Feb 2007 09:09:58 +0000

Hi,

If your using Tiger (and don't mind limiting your users to the same) then you can use NSTableView and its delegate methods:

To change the height
- (float)tableView:(NSTableView *)tableView heightOfRow:(int)row

To modify each cell before display
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex


Wain


On 24 Feb 2007, at 06:07, Jones Curtis wrote:

I should have subscribed to this list and started lurking a long time ago ... probably would have gleaned much useful information. I can only hope this isn't the standard newbie question that's been asked (and answered) a thousand times.

I need to display incoming and outgoing data from a socket in a window in such a way that I can distinguish between the incoming and outgoing data. In short, I'm thinking of something roughly similar to the iChat Chat Log window. And I've had no success in trying to implement something like that.

Initially I tried working with NSTableView, but I quickly realized (correctly, I hope) that it works only with consistent row heights, and since data "chunks" vary in size much like iChat messages, that didn't work.

The iChat Chat Log window appears to use a custom view to represent a chat message - including a background color, image and the text. In my project, I need to include a line number, hex values and ascii equivalents; a background color could be used to distinguish between the two directions. It really seems to be very similar to what I want to do.

So I started thinking that I needed a custom view in a scrollview and I could simply place these "data chunk views" in the proper place. But then I thought about the NSTableView and how it largely depends on a single instance of a Cell for each column, and simply feeds in the display data before drawing the Cell.

Anyway ... if someone could give me some pointers on how I should proceed, I might be able to come up with a more concise and intelligent question.

Thanks.


-- Curtis Jones email@hidden
_______________________________________________

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

  • Prev by Date: Re: Question about NSResponder cancelOperation
  • Next by Date: Re: Emulating modifier keys
  • Previous by thread: Custom NSView That is iChat Chat Log Like
  • Next by thread: Re: Custom NSView That is iChat Chat Log Like
  • Index(es):
    • Date
    • Thread