Re: I need a suggestion for making a "console" window
Re: I need a suggestion for making a "console" window
- Subject: Re: I need a suggestion for making a "console" window
- From: Allan Odgaard <email@hidden>
- Date: Mon, 26 Apr 2004 05:18:34 +0200
On 26. Apr 2004, at 5:05, Michael Heinz wrote:
Try -(void)insertText:(id)aString
The NSTextView must be editable, however. This may be a deal-breaker.
Unfortunately, it is - it's meant to be output only.
I wonder - is it worthwhile to make it editable, do the insert, then
turn off editing? Or would that have side effects?
You may also be able to obtain the NSTextStorage object (sending
textStorage to the NSTextView) and then modify the text storage
directly.
I can't tell from the documentation if edited:range:changeInLength: is
a mandatory step if you do so, i.e. it says:
[...] Subclasses that override or add methods that alter _their_
attributed strings directly should invoke this method after making
those changes; otherwise you should not invoke this method [...]
What have me confused is that it says "their attributed strings", as if
the subclass has a new storage, different from the default (where the
default would be edited simply by sending NSAttributedString methods to
self, which NSTextStorage could have overloaded to send the proper
notifications).
** Cocoa FAQ: <
http://www.alastairs-place.net/cocoa/faq.txt> **
_______________________________________________
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.