Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!phoenix!bskendig From: bskendig@phoenix.Princeton.EDU (Brian Kendig) Newsgroups: comp.sys.mac.programmer Subject: Wanted: Code for simple text interface Message-ID: <9674@phoenix.Princeton.EDU> Date: 31 Jul 89 14:17:06 GMT Reply-To: bskendig@phoenix.Princeton.EDU (Brian Kendig) Organization: Systems Engineering, NASA Space Station Freedom Project Lines: 30 A while ago, I made a thorough search for a command-line interface for a Macintosh. The only one I found did not quite suit my needs, so I decided to take the most logical route and create my own. Here's my problem: I want to be able to open a simple window into which the user can type commands. When he types a character, it is displayed; when he types delete, a character is erased; when he types return or enter, the entire command is parsed by the program. Simple enough, right? When I use TextEdit for the text window, the user is able to go back into the stuff already displayed and edit it. I don't want this. Besides, I can't trap for the return or enter keys easily, and even when I do, I don't know how to go back to the beginning of the line and retrieve the whole thing. A simpler way would be to ignore TextEdit. I can listen for characters and echo them to the screen when I get them, and when I get a return or enter, I can parse the line. Scrolling is a tad difficult and unwieldy, but that can be overcome. The problem here is that when the user types delete, the delete appears as a *character* on the screen - one of those little white rectangles. So, how do I do this? I want to have an IBM-style interface (hold your cries; there's a method to my madness) in a window. There's got to be an easy way! Help! -- | Brian S. Kendig | I feel more like I | bskendig | | Computer Engineering | did when I got here | @phoenix.Princeton.EDU | | Princeton University | than I do now. | @PUCC.BITNET | | Systems Engineering, NASA Space Station Freedom / General Electric WP3 |