comp.lang.ada
 help / color / mirror / Atom feed
From: "Per Sandbergs" <prsa@cntw.com>
Subject: Re: GtkAda and tasking how to?.
Date: Mon, 7 May 2001 07:34:38 +0200
Date: 2001-05-07T07:34:38+02:00	[thread overview]
Message-ID: <2AqJ6.46$yj1.1347@news3.global-ip.net> (raw)
In-Reply-To: slrn9faam8.261.randhol+abuse@kiuk0156.chembio.ntnu.no

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2331 bytes --]


Thanks for the example i may end up in going this way but what i realy want
is to make the
GUI thread safe since i am deling with a server program that previos took
all commands form a socket connection aand just printet to standard output
And what i want to do is to redirect Output to the GUI and still be able to
control the GUI.

My intention was basicly to encapsulate all GUI operations called from the
program with

 |Gdk.Threads.Enter;
 |   "Do the drawing operations"
 |Gdk.Threads.Leave;
as in the example with double buffering.
But what i am getting after a while is
    Gdk-ERROR **: file gdkgc-win32.c: line 875 (gdk_gc_predraw): assertion
failed: (data->xgc == NULL)
It think it os a timing/race problem since the time the program runs seem to
be random.

(May be thei shall go the the GTK-ada list as well)
/Per Sandberg



"Preben Randhol" <randhol+abuse@pvv.org> wrote in message
news:slrn9faam8.261.randhol+abuse@kiuk0156.chembio.ntnu.no...
> 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-07  5:34 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
2001-05-07  5:34   ` Per Sandbergs [this message]
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