[10571] in The GTK GIMP ToolKit mailing list archive
[gtk-list] gtk events question
daemon@ATHENA.MIT.EDU (Marc van Kempen)
Tue Dec 1 14:15:36 1998
To: gtk-list@redhat.com
Reply-to: marc@bowtie.nl
Date: Tue, 01 Dec 1998 20:14:51 +0100
From: Marc van Kempen <marc@bowtie.nl>
Resent-From: gtk-list@redhat.com
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
----------------------------------------------------
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null