Re: Refreshing of the text



John Cupitt wrote:

You have two solutions, I think:

- Every time a packet comes in, update your widgets and call

   while( g_main_context_iteration( NULL, FALSE ) )
     ;

 this will make the screen repaint.


This is not a good idea. What if there are no packets coming in? Then your GUI would not be responding at all.

If you don't opt for a multithreaded aproach, I think you can have the main loop watch the libpcap file descriptor for you by using g_io_add_watch() or something.

--
Christer




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