Re: Concurrent processes



If you don't need a full-fledged thread, you can just stick

while (gtk_events_pending())
	gtk_main_iteration();

somewhere appropriate in your calculation function.  This will allow GUI events
to be processed from within the calculation loop.

-Josh

Valery Avaux wrote:
> 
> Hello,
> 
> I'm trying to build up a physics simulation with Glade and GTK. The main
> function of the simulation is a function called isingflip(). This
> function must do interations up to 1000000 times but the calculation is
> based on two variables controlled by two scrollbars defined in the main
> window. I have already put signal to pass the value of the scrollbars to
> the variables and it works. But when I launch the simulation by clicking
> on a button called "Simulation", the program does the calculations but
> while doing this, I cannot move anymore the scrollbars to change
> parameters.
> 
> Is there a way to let me change parameters ? Maybe lookup signals or
> somenthing like that ? I've heard something about threads but I don't
> know what it is.... I'm really a newbie so if someone could give me some
> very detailled way to do this, it would be very nice.
> 
> Thanks a lot
> 
> Valery Avaux
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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