Path: utzoo!attcan!uunet!husc6!bloom-beacon!WHEATIES.AI.MIT.EDU!sundar From: sundar@WHEATIES.AI.MIT.EDU (Sundar Narasimhan) Newsgroups: comp.windows.x Subject: Deficiency in the translation mechanism Message-ID: <8901241952.AA05880@special-k.ai.mit.edu> Date: 24 Jan 89 19:52:40 GMT References: <6312@eagle.ukc.ac.uk> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 39 Current solution (2): Write a new widget which replicates most of the code in the text widget. You are right. I decided after careful evaluation (and actually using the text widgets provided in the Athena and Hp Widget sets) to do just this. (But I don't think that it is the translation mechanism that is at fault, but rather the poor interface or hooks provided by current text widgets to the application writer). The way I think it should have been done is to have before, during, and after procedures that an application can alter or supply (these could be just callbacks but you really want to have something more like Lisp machine method combinations). The hp widget actually provides you such a facility (it has Verify callbacks on modification, for example). With this capability writing a field editor that returns on carriage return would be simple. I have, in fact a command and argument parser, that for example dispatches on characters like ' ' to attempt completing what the user typed, provide help etc. Notice that some of these operations may involve modifying the text, the cursor position etc.. operations which are very cumbersome to do in the current text edit widgets at the application level. It will also provide you a simple way to implement a tty window -- (a widget that just scrolls error messages is actually hard to do with the present text widgets -- I know this facility can also be gotten by running xterm in slave mode but then you'd have a whole extra process to contend with). I think that such an interface to a text widget is more powerful than the ones provided by the current widgets, and will make the widget useable in more applications. (Mine is currently being used by programs in a multiprocessor development environment, a plotter program, and an experimenatal motion vision analysis package -- but it runs only on Suns at this time). -Sundar