comp.lang.ada
 help / color / mirror / Atom feed
From: Manuel Carro <boris@lml.ls.fi.upm.es>
Subject: Re: Problem with gtkada and tasks
Date: 27 Jul 2001 14:31:34 +0200
Date: 2001-07-27T12:31:35+00:00	[thread overview]
Message-ID: <7s8zhah7tl.fsf@salmon.ls.fi.upm.es> (raw)
In-Reply-To: 3b612332.907204@news.bt.es


> Until t has not completed its execution, the windows do not update.
> (and in the body of the task type cell it updates the window, but it
> does not appear in screen after the tasks have died).

    I am not sure of having understood fully your problem, but the
contents of the windows are updated by the Gtk.Main.Main or
Gtk.Main.Main_Iteration procedures.  If you call the former from
inside a handler, then this is probably a mistake: the GtkAda
documentation states that:

  the GtkAda main loop (Gtk.Main.Main) can only be be run inside one
  specific tasks. In other words, you cannot call Gtk.Main.Main from any
  task other than the one that started the outer level main loop.

    If you have another task receiving events, etc, then you should
protect the access to the graphical primitives (cf. the GtkAda
documentation).  In any case, the Ada task semantics, AFAIK, does not
require a task relinquishing the CPU unless blocked (i.e., no
round-robin by default).  

    But, on the other hand, I have found (in Linux) some problems when
using concurrently the GtkAda toolkit, even using Gtk.Threads.  A safe
solution (which is the one I adopted) is to access all the graphical
primitives from a task which initializes the state and has a delay
clause which periodically updates the windows.  Any smarter solution
will be welcome.


-- 
          ||            Manuel Carro -- DLSIIS            ||
          ||           e-mail: mcarro@fi.upm.es           ||
          ||      http://lml.ls.fi.upm.es/~boris          ||
          ||    http://clip.dia.fi.upm.es/Software/Ciao   ||
          || Phone: +34 91 336-7455  FAX: +34 91 336-7412 ||




  reply	other threads:[~2001-07-27 12:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-25  8:53 Problem with gtkada and tasks Carlos Aganzo
2001-07-26 16:07 ` Ted Dennison
2001-07-27  8:16   ` Carlos Aganzo
2001-07-27 12:31     ` Manuel Carro [this message]
2001-07-30 16:57 ` David Monterroso Cabello
2001-07-31  0:40   ` MCL
2001-07-31 11:17   ` Frank
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox