comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@baesystems.com>
Subject: Re: ada & gui
Date: Fri, 29 Jul 2005 12:33:32 +0100
Date: 2005-07-29T11:34:03+00:00	[thread overview]
Message-ID: <42ea121b$1_1@glkas0286.greenlnk.net> (raw)
In-Reply-To: dccslh$2n5f$1@news2.ipartners.pl

This seems like a fairly common problem - GtkAda does have a certain 'look'
on windows that isn't as clean as Claw but Claw is Windows-only.

I have toyed with creating an abstract 'GUI' library (see below) so you
could choose between GUI-implementations at compile time. Seems to work at a
_very_ small scale - could it work with more sophisticated windowing?

From this I managed to get Claw and GtkAda both creating a window (wow!).

The new Ada2005 'interface' could clean the API up quite a bit.

Any thoughts pros/cons to this sort of framework? Could it form the basis of
a 'standard' Ada GUI library?

-- Martin


-- Top level
package GUI is
   pragma Pure (Gui);

end GUI;

-- Window aspects - could be others, e.g. for fonts, etc
package GUI.Windows_Interface is
   pragma Preelaborate (GUI.Windows_Interface);

   type A_Window is abstract tagged null record;

   type A_Window_Ptr is access all A_Window'Class;

   procedure Create (Window   : out A_Window'Class;
                     Child_Of :     A_Window_Ptr := null;
                     Title    :     String       := "") is abstract;

   procedure Destroy (Window : in out A_Window'Class) is abstract;

   procedure Restore (Window : in out A_Window'Class) is abstract;

   procedure Maximise (Window : in out A_Window'Class) is abstract;

   procedure Minimise (Window : in out A_Window'Class) is abstract;

end GUI.Windows_Interface;

with GUI.Windows_Interface;


-- Applications required Windowing functions - different for each app
generic
   type Window_Type is new GUI.Windows_Interface.A_Window with private;
   type Window_Type_Ptr is access all Window_Type;
   with procedure Create (Window   : out Window_Type'Class;
                          Child_Of :     Window_Type_Ptr := null;
                          Title    :     String          := "") is <>;
   with procedure Destroy (Window : in out Window_Type'Class) is <>;
package GUI_Interface is
end GUI_Interface;






  parent reply	other threads:[~2005-07-29 11:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-29  9:25 ada & gui Szymon Guz
2005-07-29 11:10 ` Ludovic Brenta
2005-07-29 11:43   ` Szymon Guz
2005-07-29 12:40     ` Alex R. Mosteo
2005-07-29 12:52       ` Szymon Guz
2005-07-29 13:16         ` Alex R. Mosteo
2005-07-29 13:58           ` Ludovic Brenta
2005-07-29 16:51           ` Simon Wright
2005-07-30  1:27             ` John B. Matthews
2005-07-30 10:21               ` Georg Bauhaus
2005-07-30 16:27                 ` John B. Matthews
2005-07-30 20:30               ` Simon Wright
2005-08-01  0:02                 ` John B. Matthews
2005-08-01 13:32               ` Marc A. Criley
2005-08-01 18:49                 ` Jeffrey Carter
2005-07-29 13:19         ` Ludovic Brenta
2005-07-29 14:12   ` Szymon Guz
2005-07-29 14:27     ` Ludovic Brenta
2005-07-29 14:27     ` Alex R. Mosteo
2005-07-29 11:28 ` Jeff Creem
2005-07-29 12:23   ` Szymon Guz
2005-07-29 13:27     ` Ludovic Brenta
2005-07-29 13:59       ` Szymon Guz
2005-07-29 14:20         ` Ludovic Brenta
2005-07-29 11:33 ` Martin Dowie [this message]
2005-07-29 14:59   ` Jacob Sparre Andersen
2005-07-29 12:31 ` Adrien Plisson
2005-08-02 16:11 ` Lucretia
  -- strict thread matches above, loose matches on Subject: below --
2010-12-30 14:27 ada gui Robin
2010-12-30 19:54 ` Randy Brukardt
2010-12-31  8:11   ` Robin
2022-04-05 16:26 Ada_GUI AdaMagica
2022-04-05 19:30 ` Ada_GUI Jeffrey R.Carter
2022-04-06  7:21   ` Ada_GUI Jeffrey R.Carter
2022-04-06 15:29     ` Ada_GUI AdaMagica
2022-04-06 15:38       ` Ada_GUI Jeffrey R.Carter
2022-04-06 15:52         ` Ada_GUI AdaMagica
2022-04-08 14:05           ` Ada_GUI AdaMagica
2022-04-08 14:31             ` Ada_GUI Jeffrey R.Carter
2022-04-08 20:56               ` Ada_GUI Jeffrey R.Carter
2022-04-09 11:59               ` Ada_GUI AdaMagica
2022-04-09 13:38                 ` Ada_GUI Jeffrey R.Carter
2022-04-10 11:45                   ` Ada_GUI AdaMagica
2022-04-10 13:23                     ` Ada_GUI Jeffrey R.Carter
2022-04-10 12:12                   ` Ada_GUI AdaMagica
2022-04-06 15:31     ` Ada_GUI Jeffrey R.Carter
replies disabled

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