[MacRuby-devel] Is this the right list?

Eloy Duran eloy.de.enige at gmail.com
Mon Jan 12 16:22:13 PST 2009


How about @text_view.setString("foo") or as @text_view.string = "foo" ?

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSText_Class/Reference/Reference.html#/ 
/apple_ref/doc/uid/20000367-setString_

- Eloy

On 13 jan 2009, at 00:46, Timothy McDowell wrote:

> Y'know what, that doesn't seem to work actually. No '<<' method, and  
> setCharacters/setWords works, but nothing shows up.
>
> On Mon, Jan 12, 2009 at 4:34 PM, Timothy McDowell  
> <tmcdowell at gmail.com> wrote:
> Haha, I scoured that documentation for an hour! Thanks a bunch. ^_^
>
>
> On Mon, Jan 12, 2009 at 4:16 PM, Vincent Isambart <vincent.isambart at gmail.com 
> > wrote:
>
> :textview is linked to an NSTextView object via InterfaceBuilder.  
> Now the purpose of this view is to work as the display for text  
> coming from a MUD (Multi-user domain/dungeon). I have it set to  
> noneditable but selectable. My above code doesn't work. I allow it  
> to be editable, and the code does work. Is there a way to prevent  
> user-editing but to allow my code to edit it?
>
> Extract from Apple's Objective-C insertText: documentation:
> This method is the entry point for inserting text typed by the user  
> and is generally not suitable for other purposes. Programmatic  
> modification of the text is best done by operating on the text  
> storage directly. Because this method pertains to the actions of the  
> user, the text view must be editable for the insertion to work.
>
> You can do for instance
> @text_view.textStorage << 'my text'
> But be careful, text inserted like this ignores the current font  
> attributes of the text view. You have to add them yourself.
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
>
> -- Thanks, 
> --Zonbi.
>
>
>
> -- 
> --Brains.
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090113/41e14260/attachment.html>


More information about the MacRuby-devel mailing list