Re: how to show the content of xterm in a gtk window



On Thu, Apr 17, 2003 at 10:07:04PM +0200, Maurizio Umberto Puxeddu wrote:
> On Thu, 2003-04-17 at 01:11, Ng Sio Lei wrote:
> > hi, i want to build a gtk window to show the status such as warnings,
> > error or etc, of a running software. they are originally shown in xterm.
> 
> You should create a pipe and fork, running the application to watch as a
> child, redirecting standard I/O of the new process to the pipe. The are
> few similar ways to do this and since it's a standard unix programming
> technique you should find examples on the web. Then you can use to  
> 
> gtk_input_add_full()
> 
> or similar to what the pipes. When something arrives, you callback is
> called and you can read data and append it to your text buffer.
> 

With GLib 2.0 there's an easy function for this, 
g_spawn_async_with_pipes().

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]