From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a4ee0d6fecf1a79a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-06 22:41:47 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!kinglear.mobilixnet.dk!news1!news1.global-ip.net!news3.global-ip.net!not-for-mail From: "Per Sandbergs" Newsgroups: comp.lang.ada References: Subject: Re: GtkAda and tasking how to?. X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: <2AqJ6.46$yj1.1347@news3.global-ip.net> Date: Mon, 7 May 2001 07:34:38 +0200 NNTP-Posting-Host: 139.58.231.114 X-Trace: news3.global-ip.net 989214078 139.58.231.114 (Mon, 07 May 2001 07:41:18 MET DST) NNTP-Posting-Date: Mon, 07 May 2001 07:41:18 MET DST Xref: newsfeed.google.com comp.lang.ada:7246 Date: 2001-05-07T07:34:38+02:00 List-Id: 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" 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.�