Re: Gconf without Gnome



On Mon, 2002-04-01 at 21:28, Havoc Pennington wrote:
> 
> Paul Coates <Paul Coates ncl ac uk> writes:
> 
> > 	I don't see how to get the child process to listen to gconf directly
> > without having a gtk event loop. The child is something like
> > 
> > while(1)
> > {
> > 	sz = read(STDIN_FILENO, str, BUFSIZE);
> > 	if (sz>0)
> > 	{
> > 		// handle new task
> > 		write(STDOUT_FILENO, str, strlen(str)+1);
> > 	}
> > 	usleep(2000000);
> > }
> > 
> > so what do I add to check for notify events without using gtk?
> > 
> 
> It isn't the GTK main loop, it's the glib main loop. So your child
> could run the glib main loop and still use only glib. (If it's a pain
> to code that way you may not want to do it, but you could do it.)

Thanks, adding the line

while(g_main_pending()) g_main_iteration(FALSE);

to the above allows me to catch notify events without any extra work and
seems to work a treat.

Paul






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