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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,b6df8f8501cf7275 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.180.91.114 with SMTP id cd18mr10608576wib.2.1356942278845; Mon, 31 Dec 2012 00:24:38 -0800 (PST) Path: l12ni274875wiv.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Easiest way to build Qt/Gtk interfaces for Ada programs Date: Sat, 29 Dec 2012 01:18:34 +0100 Organization: Ada @ Home Message-ID: References: <1gda5kzj50h3l.jzmq13s0hw74.dlg@40tude.net> NNTP-Posting-Host: aWaWeUaBdaj2Zzc04J1v5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.12 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-12-29T01:18:34+01:00 List-Id: Le Fri, 28 Dec 2012 16:32:09 +0100, Dmitry A. Kazakov = a =C3=A9crit: > On Fri, 28 Dec 2012 06:51:01 -0800 (PST), alb348@gmail.com wrote: > >> I am a interested in creating GUI applications with Ada, using either= Qt >> or Gtk (it must be one of these two, because these are the only toolk= its >> that provide full BiDi support). > > One important thing, which implies the obvious consequences. There is = no > easy way of building GUI as well as no way of adding GUI to an existin= g > application. > > Ignoring casual applications, it is unfortunately so, that whatever > framework you use, and what the application is supposed to do = > functionally, > you have to build it around the GUI. On the opposite, this is the least recommended way to do. One should = create the UI around the application. The cleanest in my opinion, is to = go = for a Model View Presenter (MVP), preferably with a passive view. The = presenter is the glue between the application and the view, and is also = a = model of the view's behaviour. The view, if passive, only receive displa= y = request, along with the data (which it does not fetch itself, to be = independent from the application), and transmit events and user gestures= = to the presenter. This has some advantages, including easier separate = design and easier testing (if the communication between the presenter an= d = the view is correctly specified before). The hard part is the presenter, but the UI may be an hard part too, if y= ou = have ergonomic requirements. The UI may be made of anything, and has its= = own and separate specification. The presenter is less independent, and i= s = related to the application. You have to figure a way to setup a = communication channel between all three parts: between the application a= nd = the presenter (both way), and between the UI and the presenter (both way= = too). See: http://martinfowler.com/eaaDev/ModelViewPresenter.html Note: according to Martin Fowler, the =E2=80=9CModel View Presenter=E2=80= =9D designation = may not be relevant, but that term is still widely used, so many people = = understand it. He himself designate it under the term of =E2=80=9CSuperv= ising = Controller and Passive View=E2=80=9D instead. > There is no easy way of building GUI That part still remains true, and is not just applicable to UI alone. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity