Re: Reading from pipes (Unix)
- From: Sascha Ziemann <szi aibon ping de>
- To: gtk-list redhat com
- Subject: Re: Reading from pipes (Unix)
- Date: 12 May 1998 18:02:02 +0200
d93-mln@sm.luth.se writes:
| When using gdk_input_add to monitor a pipe for reading my callback
| function is called upon repeatedly. I only want it to be called once
| when there is new data to be read from the pipe. How do I do this??
Create the pipe:
timer_fp = popen("timer", "r");
add it to the event loop:
handle = gdk_input_add (fileno(timer_fp), GDK_INPUT_READ, update_frame, preview);
and read it in your callback:
retval = read(fd, &pipe_data, sizeof(unsigned long));
fd is fileno(timer_fp)
--
http://www.ping.de/sites/aibon/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]