home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!edcastle!whb
- From: whb@castle.ed.ac.uk (H Bruce)
- Newsgroups: comp.sys.sun.misc
- Subject: SUNVIEW - redirecting stdout to tty subwindow.
- Message-ID: <29932@castle.ed.ac.uk>
- Date: 6 Jan 93 15:04:29 GMT
- Distribution: comp
- Organization: Dept. Electrical Engineering, Edinburgh University, Scotland, UK.
- Lines: 39
-
- I have followed the sunview manual's advice for redirecting stdout to a
- tty subwindow (see appended code).
-
- This works fine for small amounts of text output (before control returns to
- window_main_loop() ), but if it exceeds approximately a page's worth ,
- the whole sunview application hangs (using very little CPU time).
- Can anyone tell me what is going wrong ?
-
- I have also been told that Sun is withdrawing support for sunview. If that is
- the case what would be the best windowing library to move to (X is an option) ?
-
- Thanks
-
-
- Henry Bruce.
-
-
- /***************************************************************************
- * void set_up_tty_window Set up tty window to view text output *
- * TTY subwindow *
- ***************************************************************************/
- void set_up_tty_window()
- {
- int tty_fd;
- tty = window_create(frame, TTY,
- TTY_ARGV, TTY_ARGV_DO_NOT_FORK,
- WIN_X, 480,
- WIN_Y, 100,
- WIN_FONT, tty_font,
- WIN_WIDTH, 500,
- WIN_HEIGHT, 600,
- 0);
-
- /* Re-direct tty output to window */
- tty_fd=(int)window_get(tty,TTY_TTY_FD);
- dup2(tty_fd,0);
- dup2(tty_fd,1);
- }
-
-