Re: callbacks: doing i/o bound stuff in them



Vassilis Pandis wrote:

--- Peter <hpklett hotmail com> wrote:

 

Both gtk functions you called emit signals.  Signals are processed in
the main loop.  sleep keeps you in the current handler, and the main
loop doesn't get any say in the matter until on_druid_pf_finish
returns.  I'm not sure I understand why sleep is actually there, but
checkout using timeouts instead.

   


I put the sleep() call to simulate my "networking function" which I haven't written yet. So
basically the actual destroying of the widget happens in main() and not when calling the gtk_blah
functions? Makes sense now....So should I do the networking part with threads or should I put a
gkt_idle_add() ?
 

As Santosh wrote, threads is probably a better idea.

              
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. 
http://uk.security.yahoo.com


 




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