On Wed, 15 Jan 2003 17:23:06 +0100 jantonio leonardo amena es wrote:
I want to load a file which it's changed every 5 seconds. So i need refresh the main window frecuently, and i want my users can do other things pressing keys or buttons. But, if i pass the control to the function gtk_main(), and GTK sleep waiting for X events, how can i refresh the file? Are "timeouts in GTK" a solution for this?
Yes. If the file is small, you could try opening, reading and closing the file in a single timeout. If the file is large, you should read it over several calls to the timeout function, so that each timeout does not take too long to finish. Otherwise your user interface will become unsresponsive. HTH, Roland -- R.F. Smith /"\ ASCII Ribbon Campaign r s m i t h @ x s 4 a l l . n l \ / No HTML/RTF in email http://www.xs4all.nl/~rsmith/ X No Word docs in email / \ Respect for open standards
Attachment:
pgp5ykNpDf3pL.pgp
Description: PGP signature