comp.lang.ada
 help / color / mirror / Atom feed
* GtkAda using Glade
@ 2011-05-17 23:58 Gary
  2011-05-18  1:14 ` John B. Matthews
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Gary @ 2011-05-17 23:58 UTC (permalink / raw)


I am evaluating Ada for a GUI app using GtkAda/Glade. I have the
latest version of Ada from AdaCore. I've had no problem getting small
example apps to work with and without Glade. What I am having a
problem with is setting up signals through Glade. I simply want to set
up the "delete" event for the main window so "gtk_main_quit" will be
executed. Exactly how do I do that? I have many years of programming
experience with many languages, but I am fairly new to Ada... although
it should just be a matter of working with it a bit to get comfortable
with it. The same goes for GTK+. I have experimented with it using C,
FreePascal, and FreeBasic... so I am familiar with the concept if not
the practice. I'm just not clear on how to set up signals with Glade.
I know you use the properties panel under the "signals" tab, but I
don't know what to put in the various fields.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-17 23:58 GtkAda using Glade Gary
@ 2011-05-18  1:14 ` John B. Matthews
  2011-05-18 11:56 ` J-P. Rosen
  2011-05-18 23:31 ` Rick
  2 siblings, 0 replies; 42+ messages in thread
From: John B. Matthews @ 2011-05-18  1:14 UTC (permalink / raw)


In article 
<15ff2ec1-5a2b-4d24-8aab-cf7985b6374f@t19g2000yql.googlegroups.com>,
 Gary <gedumer@gmail.com> wrote:

> I am evaluating Ada for a GUI app using GtkAda/Glade. I have the 
> latest version of Ada from AdaCore. I've had no problem getting small 
> example apps to work with and without Glade. What I am having a 
> problem with is setting up signals through Glade. I simply want to 
> set up the "delete" event for the main window so "gtk_main_quit" will 
> be executed. Exactly how do I do that? I have many years of 
> programming experience with many languages, but I am fairly new to 
> Ada... although it should just be a matter of working with it a bit 
> to get comfortable with it. The same goes for GTK+. I have 
> experimented with it using C, FreePascal, and FreeBasic... so I am 
> familiar with the concept if not the practice. I'm just not clear on 
> how to set up signals with Glade. I know you use the properties panel 
> under the "signals" tab, but I don't know what to put in the various 
> fields.

I'm afraid I haven't used Glade recently enough to offer detailed 
advice, but I recall studying the generated code when creating this 
example:

<http://home.roadrunner.com/~jbmatthews/gtk/lady.html>

In this tutorial,

<http://www.micahcarrick.com/gtk-glade-tutorial-part-1.html>

the window destroy callback shown in C and Pyhton,

<http://www.micahcarrick.com/gtk-glade-tutorial-part-1.html#Specifying_Callback_Functions_for>

corresponds roughly to this line in procedure Init:

Void_Cb.Connect (Win, "destroy", Void_Cb.To_Marshaller (Quit'Access));

Hope this helps.

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-17 23:58 GtkAda using Glade Gary
  2011-05-18  1:14 ` John B. Matthews
@ 2011-05-18 11:56 ` J-P. Rosen
  2011-05-18 13:58   ` Gary
  2011-05-18 23:31 ` Rick
  2 siblings, 1 reply; 42+ messages in thread
From: J-P. Rosen @ 2011-05-18 11:56 UTC (permalink / raw)


Le 18/05/2011 01:58, Gary a �crit :
> I am evaluating Ada for a GUI app using GtkAda/Glade. I have the
> latest version of Ada from AdaCore. I've had no problem getting small
> example apps to work with and without Glade. What I am having a
> problem with is setting up signals through Glade. I simply want to set
> up the "delete" event for the main window so "gtk_main_quit" will be
> executed. Exactly how do I do that?
Fairly easy (don't listen to those who will try to explain how to do it 
by hand, it is sooo much easier with glade ;-) )

Select the main window
In the "signal" panel, under GtkWidget, select "delete-event"
As the handler, select gtk_main_quit

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Adalog a d�m�nag� / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 11:56 ` J-P. Rosen
@ 2011-05-18 13:58   ` Gary
  2011-05-18 17:25     ` Dmitry A. Kazakov
  2011-05-19  5:12     ` J-P. Rosen
  0 siblings, 2 replies; 42+ messages in thread
From: Gary @ 2011-05-18 13:58 UTC (permalink / raw)


On May 18, 7:56 am, "J-P. Rosen" <ro...@adalog.fr> wrote:
> Le 18/05/2011 01:58, Gary a écrit :> I am evaluating Ada for a GUI app using GtkAda/Glade. I have the
> > latest version of Ada from AdaCore. I've had no problem getting small
> > example apps to work with and without Glade. What I am having a
> > problem with is setting up signals through Glade. I simply want to set
> > up the "delete" event for the main window so "gtk_main_quit" will be
> > executed. Exactly how do I do that?
>
> Fairly easy (don't listen to those who will try to explain how to do it
> by hand, it is sooo much easier with glade ;-) )
>
> Select the main window
> In the "signal" panel, under GtkWidget, select "delete-event"
> As the handler, select gtk_main_quit

I did that but the process is still running on Windows XP after I
close the app. The code that "Gate" generates does not look right to
me. It generates the following code in the "..._pkg_callbacks.adb"

   function Gtk_Main_Quit
     (Object : access Gtk_Widget_Record'Class;
      Params : Gtk.Arguments.Gtk_Args) return Boolean
   is
      Arg1 : Gdk_Event := To_Event (Params, 1);
   begin
      return False;
   end Gtk_Main_Quit;

This isn't right is it?



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 13:58   ` Gary
@ 2011-05-18 17:25     ` Dmitry A. Kazakov
  2011-05-18 18:24       ` Gary
  2011-05-19  5:12     ` J-P. Rosen
  1 sibling, 1 reply; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-18 17:25 UTC (permalink / raw)


On Wed, 18 May 2011 06:58:52 -0700 (PDT), Gary wrote:

> The code that "Gate" generates does not look right to
> me.

Having reached the level of understanding to tell if the code looks wrong,
why would anybody use Gate? (:-)) Seriously, sooner you ditch the crutches,
sooner you start walking...

> It generates the following code in the "..._pkg_callbacks.adb"
> 
>    function Gtk_Main_Quit
>      (Object : access Gtk_Widget_Record'Class;
>       Params : Gtk.Arguments.Gtk_Args) return Boolean
>    is
>       Arg1 : Gdk_Event := To_Event (Params, 1);
>    begin
>       return False;
>    end Gtk_Main_Quit;
> 
> This isn't right is it?

Yes, but seemingly not enough. Somewhere you should respond to "destroy"
with a call to Gtk.Main.Main_Quit.

See here for a minimal GtkAda application:

http://rosettacode.org/wiki/Simple_windowed_application#Ada

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 17:25     ` Dmitry A. Kazakov
@ 2011-05-18 18:24       ` Gary
  2011-05-18 18:27         ` Ludovic Brenta
                           ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Gary @ 2011-05-18 18:24 UTC (permalink / raw)



> Having reached the level of understanding to tell if the code looks wrong,
> why would anybody use Gate? (:-)) Seriously, sooner you ditch the crutches,
> sooner you start walking...

Are you suggesting that I dismiss the use of Glade as well or just
Gate? I know Gate converts the XML file to Ada source code, so are you
saying I should keep the XML file and load it at runtime using
Libglade... or that I should write the GUI code using "raw" GTK?

> See here for a minimal GtkAda application:
>
> http://rosettacode.org/wiki/Simple_windowed_application#Ada

This sample app uses GTK code in the source so I am guessing that you
are not in favor of Glade as well as Gate. Am I making the correct
assumption?

BTW... through experimentation, I have learned that Gate seemingly
does not correctly convert the "delete_event" signal to a complete Ada
function. I had to add the "Gtk.Main.Main_Quit" code manually to get
the app to terminate properly.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 18:24       ` Gary
@ 2011-05-18 18:27         ` Ludovic Brenta
  2011-05-18 18:42           ` Gary
  2011-05-18 20:19         ` Dmitry A. Kazakov
  2011-05-19  5:18         ` J-P. Rosen
  2 siblings, 1 reply; 42+ messages in thread
From: Ludovic Brenta @ 2011-05-18 18:27 UTC (permalink / raw)


Gary writes:
> BTW... through experimentation, I have learned that Gate seemingly
> does not correctly convert the "delete_event" signal to a complete Ada
> function. I had to add the "Gtk.Main.Main_Quit" code manually to get
> the app to terminate properly.

I don't think you can blame glade or gate for that.  Neither knows the
semantics of every signal; they emit only a skeleton implementation for
the signal handler; it is always up to you to make the signal handlers
actually do anything like, in this case, leaving the GTK+ main loop.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 18:27         ` Ludovic Brenta
@ 2011-05-18 18:42           ` Gary
  2011-05-18 21:54             ` Ludovic Brenta
  0 siblings, 1 reply; 42+ messages in thread
From: Gary @ 2011-05-18 18:42 UTC (permalink / raw)


> > BTW... through experimentation, I have learned that Gate seemingly
> > does not correctly convert the "delete_event" signal to a complete Ada
> > function. I had to add the "Gtk.Main.Main_Quit" code manually to get
> > the app to terminate properly.
>
> I don't think you can blame glade or gate for that.  Neither knows the
> semantics of every signal; they emit only a skeleton implementation for
> the signal handler; it is always up to you to make the signal handlers
> actually do anything like, in this case, leaving the GTK+ main loop.

One of the docs I read stated that a directory named ".gate" is
created when Gate is first executed which maintains a record of the
changes you make to the generated Gate source code. Supposedly, this
allows you to make modifications to the generated source and it will
be re-inserted into the source files each time you modify your Glade
output. However, I can not find such a directory on my Windows XP
machine, and every time I rerun Glade and Gate, my changes are gone.
Any thoughts on that?



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 18:24       ` Gary
  2011-05-18 18:27         ` Ludovic Brenta
@ 2011-05-18 20:19         ` Dmitry A. Kazakov
  2011-05-18 20:45           ` Gary
  2011-05-19  5:18         ` J-P. Rosen
  2 siblings, 1 reply; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-18 20:19 UTC (permalink / raw)


On Wed, 18 May 2011 11:24:11 -0700 (PDT), Gary wrote:

>> Having reached the level of understanding to tell if the code looks wrong,
>> why would anybody use Gate? (:-)) Seriously, sooner you ditch the crutches,
>> sooner you start walking...
> 
> Are you suggesting that I dismiss the use of Glade as well or just
> Gate?

I am afraid, both. At some stage you will be forced to dismiss them anyway.
Granted, I never looked at them. That is because I had experience with
other GUI generators before. So when I started to learn Gtk I didn't even
bother to look.

> I know Gate converts the XML file to Ada source code, so are you
> saying I should keep the XML file and load it at runtime using
> Libglade...

XML is a pest. There is no single case where it might be useful or at least
neutral.

If you want some sort of serialization/persistency, skins, localization of
a Gtk application, these are complicated issues to be carefully planed. In
your place I would first experiment with Gtk, before going into this.

> or that I should write the GUI code using "raw" GTK?

Yes, at least to be able to debug it.

>> See here for a minimal GtkAda application:
>>
>> http://rosettacode.org/wiki/Simple_windowed_application#Ada
> 
> This sample app uses GTK code in the source so I am guessing that you
> are not in favor of Glade as well as Gate. Am I making the correct
> assumption?

Absolutely. Gtk is a very complex thing. I cannot imagine how a code
generator could be used for TreeView, Gdk, Cairo etc. It has no chance.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 20:19         ` Dmitry A. Kazakov
@ 2011-05-18 20:45           ` Gary
  2011-05-19  7:36             ` Dmitry A. Kazakov
  0 siblings, 1 reply; 42+ messages in thread
From: Gary @ 2011-05-18 20:45 UTC (permalink / raw)


> > Are you suggesting that I dismiss the use of Glade as well or just
> > Gate?

> I am afraid, both. At some stage you will be forced to dismiss them anyway.
> Granted, I never looked at them. That is because I had experience with
> other GUI generators before. So when I started to learn Gtk I didn't even
> bother to look.

I believe I share your experience quite fully. I enjoy using GUI
builders, but I have always preferred getting into the nuts and bolts
of the code. GTK is a horse of a different color, however, when
compared to most other GUI libraries, owing to the fact that it's
written entirely in C. Your forced to learn all of the nitty gritty
details. I'm not sure I have the time required to do that, hence my
interest in Glade. At least, Gate produces Ada code that you can then
modify to your specific needs. That creates somewhat of a bridge
between the 2 worlds.

> > This sample app uses GTK code in the source so I am guessing that you
> > are not in favor of Glade as well as Gate. Am I making the correct
> > assumption?

> Absolutely. Gtk is a very complex thing. I cannot imagine how a code
> generator could be used for TreeView, Gdk, Cairo etc. It has no chance.

Thanks for your candor.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 18:42           ` Gary
@ 2011-05-18 21:54             ` Ludovic Brenta
  2011-05-18 22:09               ` Gary
  2011-05-19  5:25               ` J-P. Rosen
  0 siblings, 2 replies; 42+ messages in thread
From: Ludovic Brenta @ 2011-05-18 21:54 UTC (permalink / raw)


Gary <gedumer@gmail.com> writes:
>>> BTW... through experimentation, I have learned that Gate seemingly
>>> does not correctly convert the "delete_event" signal to a complete
>>> Ada function. I had to add the "Gtk.Main.Main_Quit" code manually to
>>> get the app to terminate properly.
>>
>> I don't think you can blame glade or gate for that.  Neither knows
>> the semantics of every signal; they emit only a skeleton
>> implementation for the signal handler; it is always up to you to make
>> the signal handlers actually do anything like, in this case, leaving
>> the GTK+ main loop.
>
> One of the docs I read stated that a directory named ".gate" is
> created when Gate is first executed which maintains a record of the
> changes you make to the generated Gate source code. Supposedly, this
> allows you to make modifications to the generated source and it will
> be re-inserted into the source files each time you modify your Glade
> output. However, I can not find such a directory on my Windows XP
> machine, and every time I rerun Glade and Gate, my changes are gone.
> Any thoughts on that?

Gate needs diff and patch to do that.  Make sure you have them
installed.  Normally, the configure script of GtkAda tries to detect the
presence of diff and patch; check the configure log to see what it
found.  If not, install diff and patch and re-run configure and the
installation procedure of GtkAda.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 21:54             ` Ludovic Brenta
@ 2011-05-18 22:09               ` Gary
  2011-05-18 23:15                 ` Ludovic Brenta
  2011-05-19  5:25               ` J-P. Rosen
  1 sibling, 1 reply; 42+ messages in thread
From: Gary @ 2011-05-18 22:09 UTC (permalink / raw)


> Gate needs diff and patch to do that.  Make sure you have them
> installed.  Normally, the configure script of GtkAda tries to detect the
> presence of diff and patch; check the configure log to see what it
> found.  If not, install diff and patch and re-run configure and the
> installation procedure of GtkAda.

I have gnudiff3.exe, gnudiff.exe, and gnupatch.exe in the "gnat/
2010.bin" directory on Windows XP and it is referenced in a PATH
environment statement. Is that what I need? If so, it doesn't work.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 22:09               ` Gary
@ 2011-05-18 23:15                 ` Ludovic Brenta
  2011-05-19  1:52                   ` Gary
  0 siblings, 1 reply; 42+ messages in thread
From: Ludovic Brenta @ 2011-05-18 23:15 UTC (permalink / raw)


Gary <gedumer@gmail.com> writes:
>> Gate needs diff and patch to do that.  Make sure you have them
>> installed.  Normally, the configure script of GtkAda tries to detect the
>> presence of diff and patch; check the configure log to see what it
>> found.  If not, install diff and patch and re-run configure and the
>> installation procedure of GtkAda.
>
> I have gnudiff3.exe, gnudiff.exe, and gnupatch.exe in the "gnat/
> 2010.bin" directory on Windows XP and it is referenced in a PATH
> environment statement. Is that what I need? If so, it doesn't work.

Check the configure log to see what it found.  Maybe it is looking for
the programs under other names.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-17 23:58 GtkAda using Glade Gary
  2011-05-18  1:14 ` John B. Matthews
  2011-05-18 11:56 ` J-P. Rosen
@ 2011-05-18 23:31 ` Rick
  2011-05-19  1:52   ` Gary
  2 siblings, 1 reply; 42+ messages in thread
From: Rick @ 2011-05-18 23:31 UTC (permalink / raw)


On May 18, 7:58 am, Gary <gedu...@gmail.com> wrote:
> I am evaluating Ada for a GUI app using GtkAda/Glade. I have the
> latest version of Ada from AdaCore.

It may be a problem with your setup/platform.  Go to:
http://adasafehouse.webs.com/gtkada.html#Getting Going
and click on GettingGtkAdaGoing.pdf

That might help.

Have a look around while you are there.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 23:15                 ` Ludovic Brenta
@ 2011-05-19  1:52                   ` Gary
  0 siblings, 0 replies; 42+ messages in thread
From: Gary @ 2011-05-19  1:52 UTC (permalink / raw)


> Check the configure log to see what it found.  Maybe it is looking for
> the programs under other names.

I'm running Windows XP... I can't find a "configure log".



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 23:31 ` Rick
@ 2011-05-19  1:52   ` Gary
  0 siblings, 0 replies; 42+ messages in thread
From: Gary @ 2011-05-19  1:52 UTC (permalink / raw)


> It may be a problem with your setup/platform.  Go to:http://adasafehouse.webs.com/gtkada.html#GettingGoing
> and click on GettingGtkAdaGoing.pdf

Nice site... I've been there before.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 13:58   ` Gary
  2011-05-18 17:25     ` Dmitry A. Kazakov
@ 2011-05-19  5:12     ` J-P. Rosen
  1 sibling, 0 replies; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19  5:12 UTC (permalink / raw)


Le 18/05/2011 15:58, Gary a �crit :
> I did that but the process is still running on Windows XP after I
> close the app. The code that "Gate" generates does not look right to
> me. It generates the following code in the "..._pkg_callbacks.adb"
> 
>    function Gtk_Main_Quit
>      (Object : access Gtk_Widget_Record'Class;
>       Params : Gtk.Arguments.Gtk_Args) return Boolean
>    is
>       Arg1 : Gdk_Event := To_Event (Params, 1);
>    begin
>       return False;
>    end Gtk_Main_Quit;
> 
> This isn't right is it?

Hmmm, looking at my code, where I ask for confirmation to quit:

function Gtk_Main_Quit (Object : access Gtk_Widget_Record'Class;
                        Params : Gtk.Arguments.Gtk_Args) return Boolean
is
   use Gtkada.Dialogs;
begin
   if Message_Dialog ("Really quit?",
                      Confirmation,
                      Button_OK or Button_Cancel) = Button_OK
   then
      Gtk.Main.Main_Quit;
      return False;
   else
      return True;
   end if;
end Gtk_Main_Quit;

So, you have to call Gtk.Main.Main_Quit explicitely



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 18:24       ` Gary
  2011-05-18 18:27         ` Ludovic Brenta
  2011-05-18 20:19         ` Dmitry A. Kazakov
@ 2011-05-19  5:18         ` J-P. Rosen
  2 siblings, 0 replies; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19  5:18 UTC (permalink / raw)


Le 18/05/2011 20:24, Gary a �crit :
> Are you suggesting that I dismiss the use of Glade as well or just
> Gate? I know Gate converts the XML file to Ada source code, so are you
> saying I should keep the XML file and load it at runtime using
> Libglade... or that I should write the GUI code using "raw" GTK?
> 
I told you not to listen to daemons ;-) ...

Personnaly, I see no benefit in generating by hand, with lots of trial
and error, what can be generated automatically. Yes, the code generated
by Gate is a skeleton that you have to beef up. But it saves you a lot
of errors; attaching signals f.e. is complicated enough... Moreover,
looking at the generated code is very instructive.

Now, it depends if you want to have your GUI ok rapidly, or want to play
(or learn) more. YMMV.
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a d�m�nag� / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 21:54             ` Ludovic Brenta
  2011-05-18 22:09               ` Gary
@ 2011-05-19  5:25               ` J-P. Rosen
  2011-05-19  9:23                 ` Manuel Collado
  1 sibling, 1 reply; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19  5:25 UTC (permalink / raw)


Le 18/05/2011 23:54, Ludovic Brenta a écrit :
>> One of the docs I read stated that a directory named ".gate" is
>> created when Gate is first executed which maintains a record of the
>> changes you make to the generated Gate source code. Supposedly, this
>> allows you to make modifications to the generated source and it will
>> be re-inserted into the source files each time you modify your Glade
>> output. However, I can not find such a directory on my Windows XP
>> machine, and every time I rerun Glade and Gate, my changes are gone.
>> Any thoughts on that?
> 
> Gate needs diff and patch to do that.  Make sure you have them
> installed.  Normally, the configure script of GtkAda tries to detect the
> presence of diff and patch; check the configure log to see what it
> found.  If not, install diff and patch and re-run configure and the
> installation procedure of GtkAda.
> 
Unless it changed recently, it is documented somewhere that round-trip
reverse engineering doesn't work on Windows (but works very nicely on
Linux), because there is nothing like a standard diff and patch.

Personnally, I have a laptop under Windows and a desktop under Linux. I
do all GUI work on Linux for that reason, then copy the resulting files
to Windows.
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a déménagé / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-18 20:45           ` Gary
@ 2011-05-19  7:36             ` Dmitry A. Kazakov
  2011-05-19 10:02               ` J-P. Rosen
                                 ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-19  7:36 UTC (permalink / raw)


On Wed, 18 May 2011 13:45:29 -0700 (PDT), Gary wrote:

> Your forced to learn all of the nitty gritty
> details. I'm not sure I have the time required to do that, hence my
> interest in Glade. At least, Gate produces Ada code that you can then
> modify to your specific needs. That creates somewhat of a bridge
> between the 2 worlds.

That's the point. If the GUI logic could be separated from the program
logic, which is a Holy Grail, but absolutely unrealistic, then it would be
no matter in which language the stuff was generated, Ada or C. You would
not never look at it.

Unfortunately the reality is that the GUI and the functional part of the
program are tightly interwoven. Therefore you need to be in full control of
both and want to shape the program's structure as you want for the sake of
clear design and maintainability (Ada's strengths). Any automatically
generated code is just an obstacle here.

Sorry for sounding daemon's voice again. (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19  5:25               ` J-P. Rosen
@ 2011-05-19  9:23                 ` Manuel Collado
  2011-05-19  9:57                   ` J-P. Rosen
  0 siblings, 1 reply; 42+ messages in thread
From: Manuel Collado @ 2011-05-19  9:23 UTC (permalink / raw)


El 19/05/2011 7:25, J-P. Rosen escribió:
> Le 18/05/2011 23:54, Ludovic Brenta a écrit :
>>> One of the docs I read stated that a directory named ".gate" is
>>> created when Gate is first executed which maintains a record of the
>>> changes you make to the generated Gate source code. Supposedly, this
>>> allows you to make modifications to the generated source and it will
>>> be re-inserted into the source files each time you modify your Glade
>>> output. However, I can not find such a directory on my Windows XP
>>> machine, and every time I rerun Glade and Gate, my changes are gone.
>>> Any thoughts on that?
>>
>> Gate needs diff and patch to do that.  Make sure you have them
>> installed.  Normally, the configure script of GtkAda tries to detect the
>> presence of diff and patch; check the configure log to see what it
>> found.  If not, install diff and patch and re-run configure and the
>> installation procedure of GtkAda.
>>
> Unless it changed recently, it is documented somewhere that round-trip
> reverse engineering doesn't work on Windows (but works very nicely on
> Linux), because there is nothing like a standard diff and patch.

There are several well-known long-standing Windows ports of GNU 
utilities. Like Cygwin or Gnuwin32, to name a few.

>
> Personnally, I have a laptop under Windows and a desktop under Linux. I
> do all GUI work on Linux for that reason, then copy the resulting files
> to Windows.

-- 
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19  9:23                 ` Manuel Collado
@ 2011-05-19  9:57                   ` J-P. Rosen
  0 siblings, 0 replies; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19  9:57 UTC (permalink / raw)


Le 19/05/2011 11:23, Manuel Collado a écrit :
> El 19/05/2011 7:25, J-P. Rosen escribió:
>> Unless it changed recently, it is documented somewhere that round-trip
>> reverse engineering doesn't work on Windows (but works very nicely on
>> Linux), because there is nothing like a standard diff and patch.
> 
> There are several well-known long-standing Windows ports of GNU
> utilities. Like Cygwin or Gnuwin32, to name a few.
> 
Sure, but they are not "standard", for what it means. I.e., you can
reasonably assume that every Unix installation provides diff and patch.
You cannot assume that any Windows installation has cygwin installed.

I am not defending Glade here - just trying to explain why round-trip is
not implemented under Windows. I definitely would welcome an install
parameter where you could define how your diff is named and where it
resides on your machine. The fact is that the Glade maintainers didn't
do it.

(I'm trying to voice this not too loud, or the guys will tell me: "what
a good idea, please do it and we'll be happy to integrate" - that's how
it happens in the free software world. Well, if there are any takers...)

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a déménagé / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19  7:36             ` Dmitry A. Kazakov
@ 2011-05-19 10:02               ` J-P. Rosen
  2011-05-19 10:28                 ` Dmitry A. Kazakov
                                   ` (2 more replies)
  2011-05-20  0:26               ` Gautier write-only
  2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
  2 siblings, 3 replies; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19 10:02 UTC (permalink / raw)


Le 19/05/2011 09:36, Dmitry A. Kazakov a �crit :
> That's the point. If the GUI logic could be separated from the program
> logic, which is a Holy Grail, but absolutely unrealistic, then it would be
> no matter in which language the stuff was generated, Ada or C. You would
> not never look at it.
> 
> Unfortunately the reality is that the GUI and the functional part of the
> program are tightly interwoven. Therefore you need to be in full control of
> both and want to shape the program's structure as you want for the sake of
> clear design and maintainability (Ada's strengths). Any automatically
> generated code is just an obstacle here.
> 
> Sorry for sounding daemon's voice again. (:-))
> 
I think you should really give Glade a try (I think you said you
didn't). Creating the various widgets (with appropriate parameters!),
stuffing them into containers, connecting call-backs constitute a really
boring (and error-prone) part of the development. That's what Glade does
for you.

In the end, you get your interface built, and a bunch of empty
procedures that you have to fill to do anything useful. These are nicely
separated, therefore you know precisely the parts that you need to fix,
and those that are generated (although looking at what is generated is
quite instructive, of course).
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a d�m�nag� / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19 10:02               ` J-P. Rosen
@ 2011-05-19 10:28                 ` Dmitry A. Kazakov
  2011-05-19 15:53                   ` J-P. Rosen
  2011-05-20  0:54                 ` Yannick Duchêne (Hibou57)
  2011-05-20  1:41                 ` Nasser M. Abbasi
  2 siblings, 1 reply; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-19 10:28 UTC (permalink / raw)


On Thu, 19 May 2011 12:02:55 +0200, J-P. Rosen wrote:

> Le 19/05/2011 09:36, Dmitry A. Kazakov a �crit :
>> That's the point. If the GUI logic could be separated from the program
>> logic, which is a Holy Grail, but absolutely unrealistic, then it would be
>> no matter in which language the stuff was generated, Ada or C. You would
>> not never look at it.
>> 
>> Unfortunately the reality is that the GUI and the functional part of the
>> program are tightly interwoven. Therefore you need to be in full control of
>> both and want to shape the program's structure as you want for the sake of
>> clear design and maintainability (Ada's strengths). Any automatically
>> generated code is just an obstacle here.
>> 
>> Sorry for sounding daemon's voice again. (:-))
>> 
> I think you should really give Glade a try (I think you said you
> didn't). Creating the various widgets (with appropriate parameters!),
> stuffing them into containers, connecting call-backs constitute a really
> boring (and error-prone) part of the development.

(That is because they are generics in GtkAda, should have been primitive
operations, but that would require making GtkAda thick bindings)

> That's what Glade does for you.

That is easy, comparing to widget subclassing (adding new signals,
properties, resource properties). Then there are custom non-widget objects
to create, e.g. cell renderers, tree stores, interfaces etc. I just don't
believe that any tool could handle this mess. (Gtk is a mess)

BTW, most boring are not handlers but things like putting a limited
component into the widget (for some reason Gtk_Widget_Record is not
limited).

I am almost sure that even handling signals does not really work with
Glade. I don't mean button click events. What about hard stuff, like events
passing parameters accessible only through GValue? There are lots of. What
about passing closure-parameters in events? That is when the receiver
object may disappear before the sender (the callback must be disconnected
before)

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19 10:28                 ` Dmitry A. Kazakov
@ 2011-05-19 15:53                   ` J-P. Rosen
  2011-05-19 22:57                     ` Gary
  0 siblings, 1 reply; 42+ messages in thread
From: J-P. Rosen @ 2011-05-19 15:53 UTC (permalink / raw)


Le 19/05/2011 12:28, Dmitry A. Kazakov a �crit :
> That is easy, comparing to widget subclassing (adding new signals,
> properties, resource properties). Then there are custom non-widget objects
> to create, e.g. cell renderers, tree stores, interfaces etc. I just don't
> believe that any tool could handle this mess. (Gtk is a mess)
Oh, I see. You are talking about extending the widgets. I am talking
about using existing ones. I never had a need to extend widgets, so I
won't comment about this.

> I am almost sure that even handling signals does not really work with
> Glade. I don't mean button click events. What about hard stuff, like events
> passing parameters accessible only through GValue? There are lots of. What
> about passing closure-parameters in events? That is when the receiver
> object may disappear before the sender (the callback must be disconnected
> before)
> 
Admitedly, I didn't go that far. And I don't think any beginner would
start with that either. Agreed, Glade might not be sufficient for
sophisticated stuff (but you should give it a try, I'm quite sure it is
more able than you think). And Glade is a great way to /learn/ how
GTK/GTKAda work.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19 15:53                   ` J-P. Rosen
@ 2011-05-19 22:57                     ` Gary
  0 siblings, 0 replies; 42+ messages in thread
From: Gary @ 2011-05-19 22:57 UTC (permalink / raw)


Thanks to all of you good people, I'm satisfied that this phase of
GtkAda development should perform quite well. I hope some of you can
help me in the next phase that I must evaluate. That being,
incorporating WebKit into GtkAda. I have created a new post entitled
"Using WebKit with GtkAda" that I hope will interest you enough that
you will offer some helpful hints as to how I may accomplish that task.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19  7:36             ` Dmitry A. Kazakov
  2011-05-19 10:02               ` J-P. Rosen
@ 2011-05-20  0:26               ` Gautier write-only
  2011-05-20  7:25                 ` Dmitry A. Kazakov
  2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
  2 siblings, 1 reply; 42+ messages in thread
From: Gautier write-only @ 2011-05-20  0:26 UTC (permalink / raw)


On 19 mai, 09:36, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> That's the point. If the GUI logic could be separated from the program
> logic, which is a Holy Grail, but absolutely unrealistic, then it would be
> no matter in which language the stuff was generated, Ada or C. You would
> not never look at it.
>
> Unfortunately the reality is that the GUI and the functional part of the
> program are tightly interwoven. Therefore you need to be in full control of
> both and want to shape the program's structure as you want for the sake of
> clear design and maintainability (Ada's strengths). Any automatically
> generated code is just an obstacle here.
>
> Sorry for sounding daemon's voice again. (:-))

I hope the smiley also applies to the last paragraph as well, and that
you are joking by saying "any automatically generated code is just an
obstacle here"...
______________________________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19  7:36             ` Dmitry A. Kazakov
  2011-05-19 10:02               ` J-P. Rosen
  2011-05-20  0:26               ` Gautier write-only
@ 2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
  2011-05-20  7:36                 ` Dmitry A. Kazakov
  2011-05-20  8:01                 ` Georg Bauhaus
  2 siblings, 2 replies; 42+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-05-20  0:49 UTC (permalink / raw)


Le Thu, 19 May 2011 09:36:07 +0200, Dmitry A. Kazakov  
<mailbox@dmitry-kazakov.de> a écrit:
> That's the point. If the GUI logic could be separated from the program
> logic, which is a Holy Grail, but absolutely unrealistic, then it would  
> be
> no matter in which language the stuff was generated, Ada or C. You would
> not never look at it.
>
> Unfortunately the reality is that the GUI and the functional part of the
> program are tightly interwoven.
Real separation could be achieved if there was a standard protocol for the  
communication between both. Because, to achieve a real separation, there  
is the need for the program to communicate with the UI as if it was an  
external entity, not an entity which is part of its own (as it is supposed  
to be in this thread).

In that matter, the paradigm of the web page (as already noticed in  
another thread) could help to learn to do things this way.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19 10:02               ` J-P. Rosen
  2011-05-19 10:28                 ` Dmitry A. Kazakov
@ 2011-05-20  0:54                 ` Yannick Duchêne (Hibou57)
  2011-05-20  1:41                 ` Nasser M. Abbasi
  2 siblings, 0 replies; 42+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-05-20  0:54 UTC (permalink / raw)


Le Thu, 19 May 2011 12:02:55 +0200, J-P. Rosen <rosen@adalog.fr> a écrit:
> I think you should really give Glade a try (I think you said you
> didn't). Creating the various widgets (with appropriate parameters!),
> stuffing them into containers, connecting call-backs constitute a really
> boring (and error-prone) part of the development. That's what Glade does
> for you.
Your are mostly right, but I believe to be more correct, we should say an  
UI is better expressed using a declarative language, and not a procedural  
language. Glade (which I only know for the creation of Python UI, not  
tested with GtkAda), indeed offers this declarative approach... anything  
else offering a declarative approach instead of the Ada's traditional  
procedural approach, would be as much good.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-19 10:02               ` J-P. Rosen
  2011-05-19 10:28                 ` Dmitry A. Kazakov
  2011-05-20  0:54                 ` Yannick Duchêne (Hibou57)
@ 2011-05-20  1:41                 ` Nasser M. Abbasi
  2011-05-20  7:19                   ` Dmitry A. Kazakov
  2 siblings, 1 reply; 42+ messages in thread
From: Nasser M. Abbasi @ 2011-05-20  1:41 UTC (permalink / raw)


On 5/19/2011 3:02 AM, J-P. Rosen wrote:

> I think you should really give Glade a try (I think you said you
> didn't). Creating the various widgets (with appropriate parameters!),
> stuffing them into containers, connecting call-backs constitute a really
> boring (and error-prone) part of the development. That's what Glade does
> for you.
>
> In the end, you get your interface built, and a bunch of empty
> procedures that you have to fill to do anything useful. These are nicely
> separated, therefore you know precisely the parts that you need to fix,
> and those that are generated (although looking at what is generated is
> quite instructive, of course).

The above sounds like how also Matlab GUIDE works. It is the 'Glade' for
Matlab. A GUI builder I use all the time to make GUI's with with matlab.

It also creates all the callback stubs, and I just go fill in the body
of the callbacks with the specific action. Very convenient, and will not
dream of developing GUI in another way. This way I concentrate on design
and layout of the GUI and let GUIDE do all the handwork. I got so good
at this, I can write one small GUI application in 1-2 days  with Matlab GUI.

For GtkAda, it will be nice if someone may be at wiki Ada or somewhere
can have a link to collection of applications written in GtkAda, where
one can download them and run them.  So far, I know of only 2-3 small apps
written in GTKAda.   Where are all the open source apps written in GTKAda?

--Nasser



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  1:41                 ` Nasser M. Abbasi
@ 2011-05-20  7:19                   ` Dmitry A. Kazakov
  2011-05-20  7:34                     ` Nasser M. Abbasi
  0 siblings, 1 reply; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-20  7:19 UTC (permalink / raw)


On Thu, 19 May 2011 18:41:50 -0700, Nasser M. Abbasi wrote:

> For GtkAda, it will be nice if someone may be at wiki Ada or somewhere
> can have a link to collection of applications written in GtkAda, where
> one can download them and run them.

I doubt that were useful. Anybody who wanted to learn Gtk should rather
look at the tests.

Real-life applications are too complex and contain too much stuff unrelated
to Gtk. They also used to bend Gtk for their specific needs or designer
preferences. For example I hate standard file selection widget, so I
designed my own. A normal user would prefer to learn the standard one
first.

> So far, I know of only 2-3 small apps
> written in GTKAda.

> Where are all the open source apps written in GTKAda?

What kind of application are you looking for? A relatively large one is
this:

   http://www.dmitry-kazakov.de/ada/fuzzy_ml.htm

A middle-sized one:

   http://www.dmitry-kazakov.de/ada/gps_installer.htm

A small one (physical measurement units converter):

   http://www.dmitry-kazakov.de/ada/units.htm

(I bet, neither could be developed using 100% Glade (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  0:26               ` Gautier write-only
@ 2011-05-20  7:25                 ` Dmitry A. Kazakov
  2011-05-20  9:50                   ` Yannick Duchêne (Hibou57)
                                     ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-20  7:25 UTC (permalink / raw)


On Thu, 19 May 2011 17:26:56 -0700 (PDT), Gautier write-only wrote:

> On 19 mai, 09:36, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
> 
>> Unfortunately the reality is that the GUI and the functional part of the
>> program are tightly interwoven. Therefore you need to be in full control of
>> both and want to shape the program's structure as you want for the sake of
>> clear design and maintainability (Ada's strengths). Any automatically
>> generated code is just an obstacle here.
>>
>> Sorry for sounding daemon's voice again. (:-))
> 
> I hope the smiley also applies to the last paragraph as well, and that
> you are joking by saying "any automatically generated code is just an
> obstacle here"...

I am not. BTW, this is one of the arguments against Ada generics. They
wandered to far into the realm of "generated" code. 

The point is simple. If the meta language is good, the object language is
irrelevant. Switch to the former. If you cannot, no reason to use it at
all.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  7:19                   ` Dmitry A. Kazakov
@ 2011-05-20  7:34                     ` Nasser M. Abbasi
  2011-05-20  7:45                       ` Dmitry A. Kazakov
  0 siblings, 1 reply; 42+ messages in thread
From: Nasser M. Abbasi @ 2011-05-20  7:34 UTC (permalink / raw)


On 5/20/2011 12:19 AM, Dmitry A. Kazakov wrote:
> On Thu, 19 May 2011 18:41:50 -0700, Nasser M. Abbasi wrote:
>
>> For GtkAda, it will be nice if someone may be at wiki Ada or somewhere
>> can have a link to collection of applications written in GtkAda, where
>> one can download them and run them.
>
> I doubt that were useful. Anybody who wanted to learn Gtk should rather
> look at the tests.
>
> Real-life applications are too complex and contain too much stuff unrelated
> to Gtk. They also used to bend Gtk for their specific needs or designer
> preferences. For example I hate standard file selection widget, so I
> designed my own. A normal user would prefer to learn the standard one
> first.
>
>> So far, I know of only 2-3 small apps
>> written in GTKAda.
>
>> Where are all the open source apps written in GTKAda?
>
> What kind of application are you looking for? A relatively large one is
> this:
>
>     http://www.dmitry-kazakov.de/ada/fuzzy_ml.htm
>
> A middle-sized one:
>
>     http://www.dmitry-kazakov.de/ada/gps_installer.htm
>
> A small one (physical measurement units converter):
>
>     http://www.dmitry-kazakov.de/ada/units.htm
>
> (I bet, neither could be developed using 100% Glade (:-))
>

Hello  Dmitry;

I was looking the other day just for examples of applications
written using Ada and GtkAda that I can download and run on my computer
just to get a feeling for how Ada GUI apps work.

Just like small utilites and such. I could only find very few such apps
some are listed here, but old list and not updated for ages.

http://libre.adacore.com/libre/tools/gtkada/

Speeking of GTK, There is now an ongoing effort to make GTK interface
for Fortran also, Here is the web page

https://github.com/jerryd/gtk-fortran/wiki

I have not tried it. But from the examples shown, it also looks good.

--Nasser



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
@ 2011-05-20  7:36                 ` Dmitry A. Kazakov
  2011-05-20  8:01                 ` Georg Bauhaus
  1 sibling, 0 replies; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-20  7:36 UTC (permalink / raw)


On Fri, 20 May 2011 02:49:09 +0200, Yannick Duch�ne (Hibou57) wrote:

> Le Thu, 19 May 2011 09:36:07 +0200, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a �crit:

>> That's the point. If the GUI logic could be separated from the program
>> logic, which is a Holy Grail, but absolutely unrealistic, then it would  be
>> no matter in which language the stuff was generated, Ada or C. You would
>> not never look at it.
>>
>> Unfortunately the reality is that the GUI and the functional part of the
>> program are tightly interwoven.

> Real separation could be achieved if there was a standard protocol for the  
> communication between both. Because, to achieve a real separation, there  
> is the need for the program to communicate with the UI as if it was an  
> external entity, not an entity which is part of its own (as it is supposed  
> to be in this thread).

No, take X11 as a counter example.

The problem is not in the physical decoupling, it is in the logical one, as
reflected in the program structure. 

> In that matter, the paradigm of the web page (as already noticed in  
> another thread) could help to learn to do things this way.

Same as with X11. You have some rendering "hard-/software" VERY
uncomfortable to use. That necessarily leads to creation of a layer to ease
usage of this mess. After that you are back to the square one (things are
coupled again). Gtk is just such a layer.

The whole "progress" of GUI software was about piling such protocols upon
layers and new protocols on them. The result is applications of 1GB size
doing same things 1MB applications did 10 years ago and 100KB ones did 20
years ago.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  7:34                     ` Nasser M. Abbasi
@ 2011-05-20  7:45                       ` Dmitry A. Kazakov
  0 siblings, 0 replies; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-20  7:45 UTC (permalink / raw)


On Fri, 20 May 2011 00:34:32 -0700, Nasser M. Abbasi wrote:

> I was looking the other day just for examples of applications
> written using Ada and GtkAda that I can download and run on my computer
> just to get a feeling for how Ada GUI apps work.
> 
> Just like small utilites and such. I could only find very few such apps
> some are listed here, but old list and not updated for ages.
> 
> http://libre.adacore.com/libre/tools/gtkada/
> 
> Speeking of GTK, There is now an ongoing effort to make GTK interface
> for Fortran also, Here is the web page
> 
> https://github.com/jerryd/gtk-fortran/wiki
> 
> I have not tried it. But from the examples shown, it also looks good.

Just go to the Rosetta Code:

   http://rosettacode.org/wiki/Welcome_to_Rosetta_Code

It has such examples straight in GtkAda:

http://rosettacode.org/wiki/Hello_world/Graphical#Ada
http://rosettacode.org/wiki/Simple_windowed_application#Ada
http://rosettacode.org/wiki/GUI_component_interaction#Ada
http://rosettacode.org/wiki/User_input/Graphical#Ada
http://rosettacode.org/wiki/Animation#Ada

etc. All samples in Rosetta Code are required to be complete and working.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
  2011-05-20  7:36                 ` Dmitry A. Kazakov
@ 2011-05-20  8:01                 ` Georg Bauhaus
  2011-05-20 10:00                   ` Yannick Duchêne (Hibou57)
  1 sibling, 1 reply; 42+ messages in thread
From: Georg Bauhaus @ 2011-05-20  8:01 UTC (permalink / raw)


Yannick Duchêne (Hibou57 ) <yannick_duchene@yahoo.fr> wrote:
> Le Thu, 19 May 2011 09:36:07 +0200, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a Ècrit:

>> Unfortunately the reality is that the GUI and the functional part of the
>> program are tightly interwoven.
> Real separation could be achieved if there was a standard protocol for the  
> communication between both. Because, to achieve a real separation, there 
> is the need for the program to communicate with the UI as if it was an  
> external entity, not an entity which is part of its own (as it is supposed  
> to be in this thread).
> 
> In that matter, the paradigm of the web page (as already noticed in  
> another thread) could help to learn to do things this way.

Indeed, a web page that does not control another application
programmatically  is an interesting comparison.

But I imagine that the new world's operating system, HTML5,
is perfect for obfuscation again: it is about at which end you keep
status information and then, about how the ends of a web program
use it later. For example, you can store status in both
browser local storage and in server side storage. Then,
distribute the whole program's status dependent control
both across web pages and server side programs:
Write source text, e.g. JavaScript functions, that has effects
at the server side, knowing that a later  JavaScript function
will then work as intended. Written in such a way, studying the source
of the client side will not reveal anything about the logic of why
the first function controls the second, indirectly.
And neither will studying the server side source reveal
how the web end logic depends on the interaction.
Reminiscent of the PHP case, isn't it?

In fact, according to Douglas Crockford speaking on stage
(URL was posted here recently), vendors are trying to push 
for a change to JavaScript that would make it a better object
code language. They are selling tools that reuse their existing 
language offerings and will produce Javascript output.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  7:25                 ` Dmitry A. Kazakov
@ 2011-05-20  9:50                   ` Yannick Duchêne (Hibou57)
  2011-05-22  6:22                   ` Gautier write-only
  2011-05-22  7:04                   ` Gautier write-only
  2 siblings, 0 replies; 42+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-05-20  9:50 UTC (permalink / raw)


Le Fri, 20 May 2011 09:25:15 +0200, Dmitry A. Kazakov  
<mailbox@dmitry-kazakov.de> a écrit:
>>> Unfortunately the reality is that the GUI and the functional part of  
>>> the
>>> program are tightly interwoven. Therefore you need to be in full  
>>> control of
>>> both and want to shape the program's structure as you want for the  
>>> sake of
>>> clear design and maintainability (Ada's strengths). Any automatically
>>> generated code is just an obstacle here.
>>>
>>> Sorry for sounding daemon's voice again. (:-))
>>
>> I hope the smiley also applies to the last paragraph as well, and that
>> you are joking by saying "any automatically generated code is just an
>> obstacle here"...
>
> I am not. BTW, this is one of the arguments against Ada generics. They
> wandered to far into the realm of "generated" code.
>
> The point is simple. If the meta language is good, the object language is
> irrelevant. Switch to the former. If you cannot, no reason to use it at
> all.

You could publish an online paper, where you could list and explain all  
the grievances your suggest against Ada's generics. May be you already did  
? If so, I would welcome a link.


-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  8:01                 ` Georg Bauhaus
@ 2011-05-20 10:00                   ` Yannick Duchêne (Hibou57)
  2011-05-20 12:55                     ` Georg Bauhaus
  0 siblings, 1 reply; 42+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-05-20 10:00 UTC (permalink / raw)


Le Fri, 20 May 2011 10:01:29 +0200, Georg Bauhaus  
<rm-host.bauhaus@maps.arcor.de> a écrit:
> In fact, according to Douglas Crockford speaking on stage
> (URL was posted here recently),
A search in the Usenet messages gave me nothing. Do you know the link ?


-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20 10:00                   ` Yannick Duchêne (Hibou57)
@ 2011-05-20 12:55                     ` Georg Bauhaus
  0 siblings, 0 replies; 42+ messages in thread
From: Georg Bauhaus @ 2011-05-20 12:55 UTC (permalink / raw)


On 20.05.11 12:00, Yannick Duchêne (Hibou57) wrote:
> Le Fri, 20 May 2011 10:01:29 +0200, Georg Bauhaus
> <rm-host.bauhaus@maps.arcor.de> a écrit:
>> In fact, according to Douglas Crockford speaking on stage
>> (URL was posted here recently),
> A search in the Usenet messages gave me nothing. Do you know the link ?
> 
> 

I think I got it from here:
http://www.infoq.com/presentations/Future-of-Programming-Languages



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  7:25                 ` Dmitry A. Kazakov
  2011-05-20  9:50                   ` Yannick Duchêne (Hibou57)
@ 2011-05-22  6:22                   ` Gautier write-only
  2011-05-22  7:04                   ` Gautier write-only
  2 siblings, 0 replies; 42+ messages in thread
From: Gautier write-only @ 2011-05-22  6:22 UTC (permalink / raw)


On 20 mai, 09:25, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> > I hope the smiley also applies to the last paragraph as well, and that
> > you are joking by saying "any automatically generated code is just an
> > obstacle here"...
>
> I am not. BTW, this is one of the arguments against Ada generics. They
> wandered to far into the realm of "generated" code.
>
> The point is simple. If the meta language is good, the object language is
> irrelevant. Switch to the former. If you cannot, no reason to use it at
> all.

I'm afraid that there is some confusion here. The code generated by a
GUI code generator has nothing to do with generics, even
coincidentally. At least the code provided by GWenerator (GWindows),
doesn't use generics. If you mean rather that generated GUI code looks
like instanciated code from Ada generics, yes it looks like, but so
what ? It doesn't go beyond that. And from a pragmatical point of
view, generated code saves lots of time, so it far from being an
obstacle. You make basic, graphical things with the GUI builder, and
with the generated code you get types you can use directly or create
classes and subclasses of GUI objects with additional functionalities,
even fully new widgets. No limitation, just a net gain in time!
G.



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-20  7:25                 ` Dmitry A. Kazakov
  2011-05-20  9:50                   ` Yannick Duchêne (Hibou57)
  2011-05-22  6:22                   ` Gautier write-only
@ 2011-05-22  7:04                   ` Gautier write-only
  2011-05-22  8:16                     ` Dmitry A. Kazakov
  2 siblings, 1 reply; 42+ messages in thread
From: Gautier write-only @ 2011-05-22  7:04 UTC (permalink / raw)


On 20 mai, 09:25, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> I am not. BTW, this is one of the arguments against Ada generics. They
> wandered to far into the realm of "generated" code.
>
> The point is simple. If the meta language is good, the object language is
> irrelevant. Switch to the former. If you cannot, no reason to use it at
> all.

Mmmh perhaps I guess you.
You may be disturbed by GUI builders that read and write the GUI info
in one kind of language (like a .rc script) and write generated Ada
code from that information, which is a one-way process. It is so
disturbing for a purist that you call it an obstacle. You'd like to
have it all in Ada: i.e. a GUI builder that is able to understand the
Ada code, display the objects, allow the user to modify them and add
other, or even create a class tree, and whenever you press save, you
have the Ada code (eventually several packages) updated ? Sure it is
possible, based on ASIS of course. Certainly a couple of full years of
programming.
Cheers
______________________________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: GtkAda using Glade
  2011-05-22  7:04                   ` Gautier write-only
@ 2011-05-22  8:16                     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 42+ messages in thread
From: Dmitry A. Kazakov @ 2011-05-22  8:16 UTC (permalink / raw)


On Sun, 22 May 2011 00:04:18 -0700 (PDT), Gautier write-only wrote:

> On 20 mai, 09:25, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
> 
>> I am not. BTW, this is one of the arguments against Ada generics. They
>> wandered to far into the realm of "generated" code.
>>
>> The point is simple. If the meta language is good, the object language is
>> irrelevant. Switch to the former. If you cannot, no reason to use it at
>> all.
> 
> Mmmh perhaps I guess you.
> You may be disturbed by GUI builders that read and write the GUI info
> in one kind of language (like a .rc script) and write generated Ada
> code from that information, which is a one-way process.

Yes that is the problem. GUI builder translates from a language X
(graphical, declarative whatever) into Ada. 

> It is so disturbing for a purist that you call it an obstacle.

If X is so good, why bother about Ada? If not, why do about X?

[There is a possibility of coexistence if applications are separable.] 

I am not a purist, I am a practitioner, who has to fight this and similar
mess daily. Any declarative layer (builders, generics/macros, object
models, protocol description languages, DB languages, source control/make
scripts etc) add an immense amount of complexity. It simply does not pay
off.

> You'd like to
> have it all in Ada: i.e. a GUI builder that is able to understand the
> Ada code, display the objects, allow the user to modify them and add
> other, or even create a class tree, and whenever you press save, you
> have the Ada code (eventually several packages) updated ? Sure it is
> possible, based on ASIS of course. Certainly a couple of full years of
> programming.

You are predicting the death of Ada programming. I am not so optimistic or
pessimistic, depending on what you like. What you describe is will not
happen. [GUI builders exist for more than 20 years.]

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2011-05-22  8:16 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 23:58 GtkAda using Glade Gary
2011-05-18  1:14 ` John B. Matthews
2011-05-18 11:56 ` J-P. Rosen
2011-05-18 13:58   ` Gary
2011-05-18 17:25     ` Dmitry A. Kazakov
2011-05-18 18:24       ` Gary
2011-05-18 18:27         ` Ludovic Brenta
2011-05-18 18:42           ` Gary
2011-05-18 21:54             ` Ludovic Brenta
2011-05-18 22:09               ` Gary
2011-05-18 23:15                 ` Ludovic Brenta
2011-05-19  1:52                   ` Gary
2011-05-19  5:25               ` J-P. Rosen
2011-05-19  9:23                 ` Manuel Collado
2011-05-19  9:57                   ` J-P. Rosen
2011-05-18 20:19         ` Dmitry A. Kazakov
2011-05-18 20:45           ` Gary
2011-05-19  7:36             ` Dmitry A. Kazakov
2011-05-19 10:02               ` J-P. Rosen
2011-05-19 10:28                 ` Dmitry A. Kazakov
2011-05-19 15:53                   ` J-P. Rosen
2011-05-19 22:57                     ` Gary
2011-05-20  0:54                 ` Yannick Duchêne (Hibou57)
2011-05-20  1:41                 ` Nasser M. Abbasi
2011-05-20  7:19                   ` Dmitry A. Kazakov
2011-05-20  7:34                     ` Nasser M. Abbasi
2011-05-20  7:45                       ` Dmitry A. Kazakov
2011-05-20  0:26               ` Gautier write-only
2011-05-20  7:25                 ` Dmitry A. Kazakov
2011-05-20  9:50                   ` Yannick Duchêne (Hibou57)
2011-05-22  6:22                   ` Gautier write-only
2011-05-22  7:04                   ` Gautier write-only
2011-05-22  8:16                     ` Dmitry A. Kazakov
2011-05-20  0:49               ` Yannick Duchêne (Hibou57)
2011-05-20  7:36                 ` Dmitry A. Kazakov
2011-05-20  8:01                 ` Georg Bauhaus
2011-05-20 10:00                   ` Yannick Duchêne (Hibou57)
2011-05-20 12:55                     ` Georg Bauhaus
2011-05-19  5:18         ` J-P. Rosen
2011-05-19  5:12     ` J-P. Rosen
2011-05-18 23:31 ` Rick
2011-05-19  1:52   ` Gary

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