comp.lang.ada
 help / color / mirror / Atom feed
From: Tomas Hlavaty <hlavaty@labe.felk.cvut.cz>
Subject: Tasking with GtkAda
Date: Mon, 23 Apr 2001 10:10:48 +0200
Date: 2001-04-23T10:10:48+02:00	[thread overview]
Message-ID: <3AE3E388.7E396BD0@labe.felk.cvut.cz> (raw)

Hi all,

I'm looking for more complicated examples of tasking with GtkAda than
the one in the GtkAda UG. Could you help me?

I need to design a distributed application with Glade. Clients should
have GtkAda GUI, but I don't know, how to pass data from server to a
GtkAda widget.

I created very simple distributed application with Glade. Server counts
queries of clients and both, server and client display the number of
current query to stdout. I would like to make the client, which displays
the query number in GtkAda widget (e.g. Gtk.Label).

-------------- example ---------------------

-- types.ads

package Types is
   pragma Pure;

   type Customer_T is new String;

end Types;

-- server.ads

with Types; use Types;

package Server is
   pragma Remote_Call_Interface;

   function Get_Counter (Customer: in Customer_T) return Positive;

end Server;

-- server.adb

with Text_Io; use Text_Io;

package body Server is

   Counter: Positive := Positive'First;

   function Get_Counter (Customer: in Customer_T) return Positive is
   begin
      Put_Line (Counter'Img);
      Counter := Counter + 1;
      return Counter;
   end Get_Counter;

end Server;

-- manager.adb

with Text_Io; use Text_Io;
with Server; use Server;

procedure Manager is
begin
   loop
      Put_Line (".");
      delay 1.0;
   end loop;
end Manager;

-- client.adb

with Text_Io; use Text_Io;
with Types; use Types;
with Server; use Server;

procedure Client is
   Customer: Customer_T := "client";
begin
   loop
      Put_Line (Get_Counter (Customer)'Img);
      delay 1.0;
   end loop;
end Client;

-- simcity.cfg

configuration Simcity is

    pragma Version (False);

    pragma Starter (None);

    pragma Boot_Location ("tcp", "localhost:5558");

    Server_Partition: Partition := (Server);

    procedure Manager is in Server_Partition;

    procedure Client;

    Client_Partition: Partition;
    for Client_Partition'Termination use Local_Termination;
    for Client_Partition'Main use Client;

end Simcity;

------------- end of example -----------------

Thanks,

Tomas



             reply	other threads:[~2001-04-23  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-23  8:10 Tomas Hlavaty [this message]
2001-04-27 16:52 ` Tasking with GtkAda Frank
2001-04-28 11:19   ` 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