home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sun / misc / 6150 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.5 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!edcastle!whb
  2. From: whb@castle.ed.ac.uk (H Bruce)
  3. Newsgroups: comp.sys.sun.misc
  4. Subject: SUNVIEW - redirecting stdout to tty subwindow.
  5. Message-ID: <29932@castle.ed.ac.uk>
  6. Date: 6 Jan 93 15:04:29 GMT
  7. Distribution: comp
  8. Organization: Dept. Electrical Engineering, Edinburgh University, Scotland, UK.
  9. Lines: 39
  10.  
  11. I have followed the sunview manual's advice for redirecting stdout to a 
  12. tty subwindow (see appended code).
  13.  
  14. This works fine for small amounts of text output (before control returns to
  15. window_main_loop() ), but if it exceeds approximately a page's worth ,
  16. the whole sunview application hangs (using very little CPU time).
  17. Can anyone tell me what is going wrong ?
  18.  
  19. I have also been told that Sun is withdrawing support for sunview. If that is
  20. the case what would be the best windowing library to move to (X is an option) ?
  21.  
  22. Thanks
  23.  
  24.  
  25. Henry Bruce.
  26.  
  27.  
  28. /***************************************************************************
  29. *  void set_up_tty_window         Set up tty window to view text output    *
  30. *                                 TTY subwindow                            *
  31. ***************************************************************************/
  32. void set_up_tty_window() 
  33. {
  34.    int tty_fd;   
  35.    tty = window_create(frame, TTY,
  36.       TTY_ARGV, TTY_ARGV_DO_NOT_FORK, 
  37.       WIN_X, 480,
  38.       WIN_Y, 100,
  39.       WIN_FONT, tty_font,
  40.       WIN_WIDTH, 500,
  41.       WIN_HEIGHT, 600,
  42.       0);
  43.  
  44.    /* Re-direct tty output to window */
  45.    tty_fd=(int)window_get(tty,TTY_TTY_FD);
  46.    dup2(tty_fd,0);
  47.    dup2(tty_fd,1);
  48. }
  49.  
  50.