Re: Loading a file on startup



Markus Lausser <sgop users sourceforge net> wrote:
Hello.

I want to load a huge file on startup, this lasts up to a few minutes, but
my application should not freeze.
At the moment i have realized this with a gtk_idle_add(), but i would prefer
the gdk_input_add() method. But this freezes my application until the whole
file was read.

And now i wonder:
if i use gtk_input_add() on a socket to download from another machine, my app
never freezes (also if there is always data available). SO, why does my app 
when reading from a file?

Am i doing something wrong here?

Markus.


Speaking in general terms, maybe you should start a worker thread to load
the file, and send an event (or something) to the gui thread when done.





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