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: a07f3367d7,b6df8f8501cf7275 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.96.231 with SMTP id dv7mr9136185wib.6.1356948540393; Mon, 31 Dec 2012 02:09:00 -0800 (PST) MIME-Version: 1.0 Path: l12ni275016wiv.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!216.196.98.146.MISMATCH!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!news.mi.ras.ru!goblin2!goblin1!goblin3!goblin.stu.neva.ru!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Easiest way to build Qt/Gtk interfaces for Ada programs Date: Fri, 28 Dec 2012 18:27:29 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1gda5kzj50h3l.jzmq13s0hw74.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1356740850 12022 69.95.181.76 (29 Dec 2012 00:27:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 29 Dec 2012 00:27:30 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-12-28T18:27:29-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1gda5kzj50h3l.jzmq13s0hw74.dlg@40tude.net... > 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 toolkits >> 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 existing > application. This I agree with... ... >> My question is: is there any GUI builder, either for Qt or for Qt, which >> will allow me to graphically design the widgets, and which will then >> generate Ada code? > > Wasting time, but you won't believe me anyway. So take any, it is actually > no matter. Once you have it behind you, you can make a fresh start and > begin working productively. ...but I don't agree with this. It's certainly possible to create a GUI Builder that does most of the busy-work but still allows one to write the rest of a application. We tried to accomplish that with the Claw builder, and we were reasonably successful. (All of my Claw programs [except the builder itself] have all of the menus and dialogs created with the builder.) The key is to take advantage of the easy separation that Ada provides into parts generated by the builder and parts written manually. Ada helps this along with separate specifications and bodies, and with child units. For a typical dialog, the call-back routines are placed in a child package and (something that we did wrong in the Claw builder but may fix in a future version) the specification can be generated based on which call-backs are needed. This way, the compiler clearly flags mismatched or missing call-backs, and it's clear which ones are needed. We also make it possible to manually select the type names and package names for each generated entity, so these can be meaningful and not just some randomly selected thing. The result is readable code clearly separated into machine generated and programmer-written parts. (And of course, the programmer written parts can reference details of the machine generated code.) If I had to lay out dialogs manually, it would take days of edit/compile/test/repeat loop to get a layout that doesn't look like it is created by an ape. At least with a GUI builder, you can reposition controls (widgets in GTK parlance) until the dialong looks sane. Very complex things still need to be written by hand, but of course Claw makes that as easy as possible. But simply avoiding writing a huge pile of busywork code (it tends to be over 50% of the code total in my Claw programs) saves a lot of time. (Especially as that code very rarely has errors, as such errors are bugs in the GUI Builder.) I suspect that most GUI builders try to take "easier" approaches, but they don't scale well at all. For instance, you have to be able to put the hand-written code under version control, be able to use your favorite IDE to create it, and use all of your favorite development tools on it. It *cannot* be written inside of the GUI builder and do any significant part of that. Randy.