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-Thread: 103376,34191e2c05ab90f1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!easynet-monga!easynet.net!feed4.jnfs.ja.net!feed3.jnfs.ja.net!jnfs.ja.net!heffalump.dur.ac.uk!nntphost.dur.ac.uk!projectcolo.org.uk!caladan!bbc!news-peer-lilac.gradwell.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada References: Subject: Re: ada & gui Date: Fri, 29 Jul 2005 12:33:32 +0100 Organization: BAE SYSTEMS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Message-ID: <42ea121b$1_1@glkas0286.greenlnk.net> X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Date: 29 Jul 2005 11:34:03 GMT NNTP-Posting-Host: 20.133.0.1 X-Trace: 1122636843 news.gradwell.net 38043 dnews/20.133.0.1 X-Complaints-To: news-abuse@gradwell.net Xref: g2news1.google.com comp.lang.ada:3835 Date: 2005-07-29T11:34:03+00:00 List-Id: 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;