Re: thread
- From: Paul Davis <paul linuxaudiosystems com>
- To: "Blowfish" <blow_fish telkom net>
- Cc: gtk-list gnome org
- Subject: Re: thread
- Date: Wed, 13 Nov 2002 16:55:17 -0500
>i have 2 gtkbutton, i'm doing a heavy load process when i
>click my button1
>
>void
>on_button1_clicked (GtkButton *button, gpointer
>user_data)
>
>{
>
> gdk_threads_enter ();
>
> while(1) {
> do_heavy_load();
> }
>
> gdk_threads_leave();
>
>}
>
>how can i stop my process with button2 ?, because the
>program seems to be waiting button1 callback function to
>finished executing ?
you need to run do_heavy_load() in its own thread. the code you have
above doesn't do that (though you might possibly believe that it
does).
alternatively, make sure you call this (below) frequently within
do_heavy_load():
while (gtk_events_pending()) {
gtk_main_iteration();
}
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]