Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!udel!princeton!phoenix!bskendig From: bskendig@phoenix.Princeton.EDU (Brian Kendig) Newsgroups: comp.sys.mac.programmer Subject: Re: Wanted: Code for simple text interface Message-ID: <9676@phoenix.Princeton.EDU> Date: 31 Jul 89 17:30:44 GMT References: <9674@phoenix.Princeton.EDU> <43528@bbn.COM> Reply-To: bskendig@phoenix.Princeton.EDU (Brian Kendig) Organization: Systems Engineering, NASA Space Station Freedom Project Lines: 62 In article <43528@bbn.COM> levin@BBN.COM (Joel B Levin) writes: >In article <9674@phoenix.Princeton.EDU> bskendig@phoenix.Princeton.EDU (Brian Kendig) writes: >|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 don't just echo the characters, look at them. If you get a delete, >don't echo it, erase the previous character. If you get a word-delete >character (whatever you choose), don't echo it, erase the previous >word, etc. terminal interfaces have been doing this for years! Sounds simple enough, doesn't it? But: how do I erase the previous character? If I send a 'delete' to the window, it appears as a gremlin (the 'technical' name for those little white rectangles). Methinks I'd have to do some pretty snappy QuickDraw manipulations to manually erase the graphic shape of the last character I sent to the screen; think for a moment about the sheer number of calculations involved in such a move and you'll see why I don't care to try it. If I could figure out how to erase the last character I sent to the screen (and ones before that, then, if the user types delete more than once), I would be a happy puppy. (Then, what about a flashing cursor...? Ugh.) Barring that, if that ain't possible, I'd have to mess with TextEdit somehow. How? I don't know. I'd have to disable moving the cursor with mouse clicks, at the very least. TE would take care of the delete key. If I could trap for a carriage return (and I think I know how to), how can I get back into the TE record and extract all the text between this CR and the last one? I know this stuff is possible. The terminal program I'm using is doing it (well, kind of) right now. >| ... 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! > >I'll leave the flames to others, I sense them coming... Actually, the reason I want to do this is to attract the attention of those poor souls who think that COMPLEXITY=POWER. They think that if they have to learn how to type all sorts of convoluted commands, they can do more than pointing-and-clicking could ever get them. With a little work, I could easily (?!) get this thing to recognize commands from Unix, MS-D*S, CP/M... you name it. Ain't resources great? Besides, I'd use this interface myself. Typing "cd HD:Applications:Word proc: MacWrite files" is *much* faster than digging through four cluttered windows and looking for specific folder icons. (Well, maybe not *much* faster... but you get the general idea.) Hm. Imagine what people would think of HyperCard if you were to run it on an IBM text-only system! > /JBL >UUCP: levin@bbn.com (new) or {backbone}!bbn!levin (old) >INTERNET: levin@bbn.com POTS: (617) 873-3463 -- | 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 |