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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a7bbea44913cfde8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-28 04:19:11 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!129.240.148.23!uio.no!ntnu.no!randhol+abuse From: randhol+abuse@pvv.org (Preben Randhol) Newsgroups: comp.lang.ada Subject: Re: Tasking with GtkAda Date: Sat, 28 Apr 2001 11:19:10 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3AE3E388.7E396BD0@labe.felk.cvut.cz> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: tyfon.itea.ntnu.no 988456750 12781 129.241.83.82 (28 Apr 2001 11:19:10 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Sat, 28 Apr 2001 11:19:10 +0000 (UTC) User-Agent: slrn/0.9.7.0 (Linux) Xref: newsfeed.google.com comp.lang.ada:7016 Date: 2001-04-28T11:19:10+00:00 List-Id: On Fri, 27 Apr 2001 18:52:04 +0200, Frank wrote: > Hi! > > Perhaps you can use a idle function in the Gtk client to poll for your data. > I don't know if it is a optimal solution, but I have managed that work on a > client task to server task (non-distributed) > situation I don't know if this is what you are looking for, but I have a small app that displays GtkAda Dialogs using Ada Tasks. The program is not finished so I have only included some of the code below to illustrate how you can do it. Also look under doublebuffer in the examples that follow GtkAda. ------------------ -- avtale.adb ------------------ with Notify_Task_Pkg; use Notify_Task_Pkg; procedure avtale is begin delay 5.0; loop -- main loop do clever stuff here ;-) New_Dialog; -- call a Dialog to be shown using GtkAda delay 10.0; -- waits 10 second and then show a new dialog. Program -- is not finished ! :-) end loop; end avtale; ---------------------- -- notify_task_pkg.adb ---------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Exceptions; use Ada.Exceptions; package body Notify_Task_Pkg is task Notify_task is entry New_Dialog; end Notify_task; task body Notify_task is task body Notify_task is Notify_Dialog : Notify_Dialog_Access; begin Gtk.Main.Set_Locale; Gdk.Threads.Init; Gtk.Main.Init; loop select accept New_Dialog do Gtk_New (Notify_Dialog, "This is a Notify widget that can be used with" & ASCII.LF & "Ada 95 programs. It is completely written in " & ASCII.LF & "Ada 95 using the GtkAda library."); Show_All (Notify_Dialog ); end New_Dialog; else 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 Notify_task; procedure New_Dialog is begin Notify_Task.New_Dialog; end New_Dialog; end Notify_Task_Pkg; -- Preben Randhol ------------------- http://www.pvv.org/~randhol/ -- �For me, Ada95 puts back the joy in programming.�