[gtkada] GtkAda and tasking
Jean-Pierre Rosen
rosen.adalog at wanadoo.fr
Thu Apr 20 12:01:13 CEST 2000
From: Emmanuel Briot <briot at gnat.com>
> What about having a separate task that would be the main loop, something
like
> (the syntax is not accurate, this is only to give a rough idea):
>
> while not Gtk.Main.Main_Iteration (Blocking => True) loop
> Main_Task.Event_Processed;
> end loop;
>
> and a main task that would do all the synchronization:
>
> loop
> select
> accept Event_Processed do
> ...
> end Event_Processed;
> or
> ...
> end select;
> end loop;
>
> Since Main_Iteratio is blocking, wouldn't something similar to this solve
your
> problem ? (In fact, Main_Iteration might not be the best function, since
it
> will process the event)
>
While I'm blocked in Main_Iteration, I can't communicate....
To give you an idea of what I'm trying to do:
it is for a utility to synchronize a laptop with a desktop. The bulk of the
processing is scanning directories, and this is performed by a background
task. When there is a discrepancy, a window asks the user what to do. I'd
like to have a label in that window that tells wich directory is being
processed, so it will be constantly changing, even during user interaction.
Conversely (as I stand now), once the user has clicked on OK, I exit from
the main loop, so the window that stays on the screen cannot be moved any
more (I do not want to have windows popping in and out all the time).
It is likely that I'll have to write my own main loop, but to do so I'd
better have a look at the current main loop. Since it is directly imported
from C, I don't have the source. Where can it be found (if possible, without
downloading the whole Gtk) ?
To be honnest: the current implementation is based on Tash, and I have the
same problem. I'm investigating whether GtkAda could be a better solution.
---------------------------------------------------------
J-P. Rosen (Rosen.Adalog at wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog
More information about the gtkada
mailing list