Subclassing NSLayoutManager
Subclassing NSLayoutManager
- Subject: Subclassing NSLayoutManager
- From: Adrian Rutledge <email@hidden>
- Date: Sat, 6 Jul 2002 22:50:19 -0500
Well, now, people are likely going to ask me why I want to go and do a
stupid thing like that. See, though, I'm developing an IRC client. I'm
going for something akin to X-Chat's text output, if anyone has seen
it. It has the nickname of the poster, enclosed in <>s and right
aligned to a line. On the other side of the line is has the message,
left aligned to the same line. In my server connectivity class I've
already got the message cut into pieces, with the prefix (who its from),
the target, and the type of message set as attributes. According to the
NSLayoutManager documentation that is what I subclass to handle custom
attributes. First off, I want to display the name in one
NSTextContainer/NSTextView, the message in another, similar to X-Chat.
Second, I'd like to be able to color messages depending on what type of
message they are, so, use the type of message attribute as a color
hint. According to what little I could find in the documentation I
would use a custom subclass on NSLayoutManager to do that but I don't
know how to go about subclassing it. Specifically, some pointers at
which methods I override to handle custom attributes and to do the
pushing of the nick into one NSTextContainer/NSTextView.
Sorry if this post is rambling or otherwise not very clear, I can make
another run at explaining it if anyone would like.
-Atma
PS: I've got the server connectivity class nearly complete, if anyone
wants a peek at it. Its not commented well and the only thing that's
not done is that it doesn't pass messages up to channels and queries
yet, because I've yet to _CODE_ the channel and query model classes.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.