comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Easiest way to build Qt/Gtk interfaces for Ada programs
Date: Fri, 28 Dec 2012 18:27:29 -0600
Date: 2012-12-28T18:27:29-06:00	[thread overview]
Message-ID: <kblddi$bnm$1@munin.nbi.dk> (raw)
In-Reply-To: 1gda5kzj50h3l.jzmq13s0hw74.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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.





  parent reply	other threads:[~2012-12-29  0:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 14:51 Easiest way to build Qt/Gtk interfaces for Ada programs alb348
2012-12-28 15:32 ` Dmitry A. Kazakov
2012-12-28 17:30   ` alb348
2012-12-28 17:57     ` Dmitry A. Kazakov
2012-12-29  0:18   ` Yannick Duchêne (Hibou57)
2012-12-29  9:26     ` Dmitry A. Kazakov
2012-12-29 10:39       ` Yannick Duchêne (Hibou57)
2012-12-29 12:27         ` Dmitry A. Kazakov
2012-12-29 13:07           ` Georg Bauhaus
2012-12-29 13:26             ` Yannick Duchêne (Hibou57)
2012-12-29 13:09           ` Yannick Duchêne (Hibou57)
2012-12-29  0:27   ` Randy Brukardt [this message]
2012-12-29  1:02     ` Georg Bauhaus
2012-12-29  2:10       ` Yannick Duchêne (Hibou57)
2012-12-29  8:55       ` Dmitry A. Kazakov
2012-12-28 16:20 ` Vadim Godunko
2012-12-28 19:56   ` alb348
2012-12-28 20:38     ` Justin Time
2012-12-28 20:52       ` alb348
2012-12-29  0:48         ` Randy Brukardt
2012-12-29 10:23           ` Blady
2012-12-29 10:51             ` Yannick Duchêne (Hibou57)
2012-12-29 15:24           ` Justin Time
2012-12-31 21:49             ` Randy Brukardt
2013-01-01 10:46               ` Justin Time
2013-01-01 12:24                 ` Dmitry A. Kazakov
2013-01-01 16:55                   ` Justin Time
2013-01-02 10:00                     ` Dmitry A. Kazakov
2012-12-28 17:58 ` Justin Time
2012-12-31  8:07   ` ldries46
2012-12-31 20:58     ` John B. Matthews
2013-01-04 23:39     ` Brian Drummond
2012-12-29 16:40 ` leonid.dulman
2012-12-29 18:12   ` alb348
2012-12-30 17:27 ` leonid.dulman
2013-01-04 13:53   ` Patrick
2013-01-04 23:31     ` Brian Drummond
2013-01-05  8:57       ` Dmitry A. Kazakov
replies disabled

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