Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

robvas

macrumors 68040
Original poster
Mar 29, 2009
3,240
631
USA
I'm trying to write an IRC client, and am trying to figure out the best way to handle multiple channels and nick lists. There's a chat log for each channel (which I imagine will get very long, thousands of lines) and the nick list is just a list of everyone in that channel (probably 10-200 user names).

What's the best way to organize this? I thought about having 2 NSTextViews in my nib file, and then when you click an NSButton (one is created for each channel you join), it replaces the text with the stored buffer from that channel. I should be able to just change the pointer to the text data, and avoid having to copy it all each time I switch channels, correct?

The other way I thought of doing it was creating a NSTextView for the nick list and the chat log for each channel. Then when you click a button to switch to a channel, you just show those NSTextViews, the rest will be set to hide. I figure that way will also make it easier to split each channel into it's own document or chat window in the future, so you can see more than one channel at a time.

Here's a screenshot from x-chat so you can see what I mean:

OGTtt.png


They don't show a nick list, but mIRC does:

MxbHT.gif
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.