Re: Read from file.



David Larsson wrote:

Hi.

I'm sort of new to this and I wonder how you make a GTK+ application
to read from a file every 10 minutes or so? Some sort of Auto-Read.


You can use the gtk_timeout_add function. But using a IO-notify
mechanism should be more effective than reading the file every 10

minutes even if it didn't change.

There is a IO-notify mechanism in GTK (using gtk_input_add)
and one in the GLib, using GIOChannels and the g_io_add_watch
function. I don't why there are both of them, but gtk_input_add
works fine.

--
 ** Gael Le Mignot, Ing3 EPITA, Coder of The Kilobug Team **
Home Mail : kilobug freesurf fr          Work Mail : le-mig_g epita fr
GSM       : 06.71.47.18.22 (in France)   ICQ UIN   : 7299959
Web       : http://kilobug.freesurf.fr or http://drizzt.dyndns.org

"Software is like sex it's better when it's free.", Linus Torvalds




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