gtk events question




Hi,

I'm trying to execute an external program and have a 
popup which signals the user to wait for the program to
end. In my callback which executes the program I have 
something like:

jb_msg_create("wait blabla");		/* this creates the popup window */

/* now try to wait until the window has been created and displayed */
n = gtk_events_pending();
for (i=0; i<n; i++) {
	gtk_main_iteration();
}
	
exec_program();

jb_show_results();

return;


But this doesn't give me the desired result as it does not handle
all pending events, so I must be doing something wrong.

I then tried:

    n = gtk_events_pending();
    while (n > 0) {
	for (i=0; i<n;i++) {
	    gtk_main_iteration();
	}
	n = gtk_events_pending();
    }


But this is blocking in gtk_main_iteration() and will only continue
after I move the mouse.

So what is the recommended way of handling such a scenario?

Regards,
Marc.

----------------------------------------------------
Marc van Kempen                 BowTie Technology     
Email: marc@bowtie.nl            WWW & Databases
tel. +31 40 2 43 20 65         
fax. +31 40 2 44 21 86         http://www.bowtie.nl
----------------------------------------------------





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