comp.lang.ada
 help / color / mirror / Atom feed
* Tasking with GtkAda
@ 2001-04-23  8:10 Tomas Hlavaty
  2001-04-27 16:52 ` Frank
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Hlavaty @ 2001-04-23  8:10 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-04-28 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23  8:10 Tasking with GtkAda Tomas Hlavaty
2001-04-27 16:52 ` Frank
2001-04-28 11:19   ` Preben Randhol

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