home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / hp / 15252 < prev    next >
Encoding:
Text File  |  1993-01-24  |  3.9 KB  |  74 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!maxwell.uwaterloo.ca!gordon
  3. From: gordon@maxwell.uwaterloo.ca (Gordon R. Strachan)
  4. Subject: Problem with vue (and solution)
  5. Message-ID: <C1CAJE.FI2@watserv2.uwaterloo.ca>
  6. Sender: news@watserv2.uwaterloo.ca
  7. Reply-To: gordon@maxwell.uwaterloo.ca (Gordon R. Strachan)
  8. Organization: University of Waterloo
  9. Date: Sun, 24 Jan 1993 03:47:38 GMT
  10. Lines: 62
  11.  
  12. I have always had one particular problem with vue, and I am sure I am not
  13. alone in this.  The situation has to do with the way the filemanager
  14. handles actions for which there are no X clients.  For this, it simply
  15. launches an hpterm in slave mode and runs the program in it.  The most
  16. common example is when the user selects the edit action to view a file.  The
  17. filemanager brings up a slave hpterm with vi running in the window.  While
  18. this seems to work, it does have some problems, particularly with vi.  The
  19. user thinks he has a normal X application in front of him and when he wants
  20. to get rid of the window he simply closes it with the mouse.  The hpterm
  21. then proceeds to kill its attatched process, vi in this example, and close
  22. the window.  But, it closes vi very rudely.  If the user was making any
  23. changes they can be lost.  At the very least, vi doesn't clean up its
  24. temporary files and slowly my /tmp and /usr/preserve directories get
  25. filled up with dead vi files.
  26.  
  27. Of course, this really isn't a major problem but it is an annoyance and can
  28. be fustrating for the niave user.  The real problem is that vue is trying
  29. to make every program look like a smart X program even when it isn't.  To do
  30. this, they used the hpterm in a slave mode to do this when it really wasn't
  31. cut out to do this.  The program in slave mode allows the none X programs
  32. to display text and key press events from the X server but that's all.  In
  33. order to solve problems like the one I mentioned above we require a much
  34. more intelligent program than this.  What is needed is a program that performs
  35. similar functions to the hpterm in slave mode and will also inform the program
  36. it is controlling about other X events such as window resizing, window
  37. closure or mapping etc.
  38.  
  39. I decided to write such a program and it has proved to be a pretty good
  40. solution to this problem.  We have been using it around here for a few months
  41. now and I thought I would release it on the net for other to try and get me
  42. some feedback.  It is fairly large so I hope no one objects to me posting it
  43. here.
  44.  
  45. The program is in two major parts.  The first, and the largest, is a terminal
  46. emulator widget.  It is a complete standalone widget that does a very
  47. complete (although not 100%) emulation of a term0 widget.  It can also be
  48. configured to emulate a vt100 terminal.  Since this section is a widget, it
  49. can be used in other programs.
  50.  
  51. The second section is the program managment program which I call XControl.  It
  52. provides a terminal emulator for the child process it runs.  It has a series
  53. of commands which perform actions on the child process and set list of X
  54. events which trigger these commands.  For example, in the distribution I have
  55. configure XControl to manage a vi process.  It loads the program and allows
  56. the user to edit normally.  If he were to try to close the window, it puts
  57. up a prompt dialog and asks the user if he wants to save the file before he
  58. exits.  If the user hits the yes button, the program instructs the editor to
  59. save its file and then exit.  If the user does not want to save then the
  60. program will tell vi to exit cleanly.
  61.  
  62. I have also added some code to the program to provide some further interaction
  63. with the vue environment.  It will interact with the session manager to save
  64. and restart cleanly (and, if configured can instruct the child process to
  65. do the same) and also to respond to drag and drops from the filemanager.  This
  66. latter functionality was done through some terrible hacking and is not
  67. guaranteed to work under 9.0.
  68.  
  69. Anyway, the code will follow.
  70.  
  71. Enjoy
  72. Gordon
  73.  
  74.