Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
Using ttysw_output() shows that the text is simply output to the dummy terminal emu-
lator described by ttysw. ttysw_input() is useful for sending data as input to a pro-
gram running in the TTY subwindow. For example, a window-based front end for a text edi-
tor could be written where all the common functions such as Save and Next Page can be pro-
grammed into panel buttons. Selecting one of those panel buttons would cause a constant
string to be sent to the application to be processed as input. The write filename function in vi
could have a button that uses ttysw_input() to send the string (w!\n) to the TTY
subwindow containing the program.
9.3 Monitoring the Program in the TTY Subwindow
When you use the TTY_ARGV attribute to pass the name of a program to run to the TTY
subwindow, the program runs as a forked child process. If the attribute:
TTY_QUIT_ON_CHILD_DEATH
is set to TRUE, then the application exits when the forked program exits. But, by default, this
attribute is set to FALSE. You can use TTY_PID to monitor the state of the child process run-
ning in the TTY window via the Notifier using notify_set_wait3_func(). The cli-
ent’s wait3() function gets called when the state of the process in the TTY subwindow
changes:*
#include <sys/wait.h>
static Notify_value my_wait3();
...
ttysw = xv_create(base_frame, TTY,
TTY_ARGV, my_argv,
NULL);
child_pid = (int)xv_get(ttysw, TTY_PID);
notify_set_wait3_
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873