comp.lang.ada
 help / color / mirror / Atom feed
From: randhol+abuse@pvv.org (Preben Randhol)
Subject: Re: GtkAda and tasking how to?.
Date: Sun, 6 May 2001 10:40:57 +0000 (UTC)
Date: 2001-05-06T10:40:57+00:00	[thread overview]
Message-ID: <slrn9faam8.261.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: Gn7J6.45$yj1.1104@news3.global-ip.net

On Sun, 6 May 2001 09:48:43 +0200, Per Sandbergs wrote:
> Colud somone phelp me with the folowing issue concering GTKAda and tasking.
> What i want to to is basiclty the folowing:
> 
> Create a GUI in GtkAda containig a Text box.and som other widgets running as
> the one Ada-task.
> I am running
>     Win NT4/2K
>     GNAT 3.14a
>     GTKAda 1.3.11

I let my main program run a loop where all the checking it wants to do
are done and then I run the GUI in a spereate task, so that when I need
to update the GUI I call the Update_GUI below:


  task body GUI_task is

  begin

    Gtk.Main.Set_Locale;
    Gdk.Threads.Init;
    Gtk.Main.Init;

    loop
      select
        accept Update_GUI do
         -- Do the stuff here.......
      else
         -- If not do all the other things the GUI wants to do...
         while Gtk.Main.Events_Pending loop
            Dead := Gtk.Main.Main_Iteration;
         end loop;
      end select;
      delay 0.01;
    end loop;

   exception
      when E : others =>
         Put_Line ("Exception raised in GUI task:" &
                   Exception_Information (E));

  end GUI_task;

Hope it helps.
-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 �For me, Ada95 puts back the joy in programming.�



  reply	other threads:[~2001-05-06 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-06  7:48 GtkAda and tasking how to? Per Sandbergs
2001-05-06 10:40 ` Preben Randhol [this message]
2001-05-07  5:34   ` Per Sandbergs
2001-05-07 10:07     ` Preben Randhol
replies disabled

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