Felix Breuer wrote:

>I want to monitor a standard unix fifo from my PyGTK app. Currently I am
>using a timeout as in:
>
>def on_timeout():
>    input = f.readline()
>    if len(input) > 0:
>        # do something ...
>
>f = open(fifo_name,"r")
>gtk.timeout_add(1000, on_timeout)
>
>But I guess there must be a better way... Which one is it?

gtk.input_add (f.fileno(), gtk.gdk.INPUT_READ, have_data_callback)

will install f's file descriptor in the gtk main loop poll array and
call 'have_data_callback' when reading from f is possible.

tim
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to