pmy@jeeves.acc.Virginia.EDU (Pete Yadlowsky) (08/28/89)
Hello, I've recently implemented a read-only scrolling text display object class which simply takes a stream and spews its contents into a horizontally and vertically scrolling window. It's a subclass of ScrollView which creates for itself a Text object and a Window object. I initially developed this object class (ScrollText) so that I could monitor the stdout of a running process from within an application. Basically, the application would start the process with popen, open a NXStream on the file descriptor returned by popen (please let me know if there's a neater way to do this) and pass this stream to a newly instantiated ScrollText object. Well, oddly enough, it works. The window opens, the text eventually appears in the view and the scroll bars adjust their sizes appropriately. BUT....the problem is that nothing appears in the window until the process being monitored has terminated, i.e. until the Text object's readText: method sees an end-of-stream. What I want is for text to appear asynchronously, as the process writes to stdout, instead waiting till the end. I guess what I'll need to do is make a subclass of Text with a modified readText: method, but I'm hoping there's an obvious and simpler solution (aren't we all?). Any ideas, folks? - Pete P.S. I know the Shell application does some of these things (how?), but I want something that's horizontally scrollable (as well as vertically), and read-only. Peter M. Yadlowsky | "Pay no attention to that man Academic Computing Center | behind the curtain!" University of Virginia | pmy@Virginia.EDU |