I'm building a client for an online text game. Which view should I use for displaying the game's streaming text output? I need to display uneditable text, ala the Mac's terminal window or the window of a telnet client.
I'm building a client for an online text game. Which view should I use for displaying the game's streaming text output? I need to display uneditable text, ala the Mac's terminal window or the window of a telnet client.
It seems like you answered your own question... the terminal seems like a reasonable place. If you're needing a "fancier" text UI, ncurses seems to be a pretty popular option.
It seems like you answered your own question... the terminal seems like a reasonable place. If you're needing a "fancier" text UI, ncurses seems to be a pretty popular option.
Well, I'd like to build the output window into the client.
I think I mis-described my project. I don't need to read the server data stream. The game provides webservices for issuing commands and receiving output. I just need an uneditable view to display the output in. I tried an NSTextView, but if you make it uneditable you can't insert text into it.
Well you can go through the textStorage of the text view. This is a NSMutableAttributedString so you can then get the unerlying mutableString and alter that directly. I'm pretty sure that works regardless of whether the view itself is editable.
Well you can go through the textStorage of the text view. This is a NSMutableAttributedString so you can then get the unerlying mutableString and alter that directly. I'm pretty sure that works regardless of whether the view itself is editable.
Did you read the documentation description for that? It's never going to work if the view is not editable. I quote from the documentation below
...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.