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: 103376,ffe4fb1477fe67e6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Michael Bode Newsgroups: comp.lang.ada Subject: Re: Newbie Needs Ada Advice Date: Tue, 08 May 2007 21:23:19 +0200 Organization: 1&1 Internet AG Message-ID: References: <1178212418.538270.283700@c35g2000hsg.googlegroups.com> <1178635220.859690.3310@y80g2000hsf.googlegroups.com> <4640923B.7060409@obry.net> <1178638047.133001.115090@o5g2000hsb.googlegroups.com> NNTP-Posting-Host: p57b606b1.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: online.de 1178652200 14098 87.182.6.177 (8 May 2007 19:23:20 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Tue, 8 May 2007 19:23:20 +0000 (UTC) X-message-flag: IMPORTANT MESSAGE -- PLEASE READ IMMEDIATELY!!! X-Accepted-File-Formats: ASCII, .rtf, .ps, .pdf - *NO* MS Office files User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Xref: g2news1.google.com comp.lang.ada:15654 Date: 2007-05-08T21:23:19+02:00 List-Id: ezkcdude writes: > It's not so much look, but the ease of doing it. For example, I would > like something like the GUI builders you can find in NetBeans. Glade > is similar, but then you have the XML stuff, which seems like even > more overhead to learn. I noticed that the version of glade bundled > with GtkAda in GPS is not the most current version. The current > version of Glade does not output source code, only XML. I'm not sure what your problem with XML is. You never need to look at the XML glade generates. The 'standard' way is to use gate to generate Ada code. I'm using myself the 'other' way: use libglade to build the GUI from the XML file. One disadvantage of this method is that you more or less use only the predefined widget types and can't derive new types from those. On the plus side you get internationalisation for free because Gnu gettext works just fine with glade files. One example: procedure Create_Window (Window : in out Window_Record; Fname : String; Root : String) is begin Gtk_New (XML => Window.XML, Fname => Fname, Root => Root, Domain => Application.I18n_Textdomain); Window.Window := Gtk_Window (Get_Widget (Window.XML, Root)); end Create_Window; I call this procedure 5 times in one of my apps for 5 different windows and it pulls in 19874 lines of XML using the right language for labels etc. and build the whole gui. What I have to do in code is connect Ada variables to the widgets like that: Main_Window.Connect_Btn := Gtk_Button (Get_Widget (Main_Window.XML, "connect")); and connect callbacks: Button_Handlers.Connect (Main_Window.Connect_Btn, "clicked", Button_Handlers.To_Marshaller (Connect_Cb'Access)); > I am not really concerned with looks. Most important are 1) > functionality 2) performance and 3) ease of programming. Java really > seems to have the upper hand in #3. Is this not the case? Sometimes code generators generate the right code, sometimes you better code by hand. Suppose you have 5 unrelated checkboxes in your window. A GUI code generator will generate 5 unrelated widget variables and 5 unrelated callback functions to handle the "clicked" events. Fine. No suppose you have 32 checkboxes that form a logical array. The code generator will generate 32 unrelated widget variables and 32 callback functions. The human programmer will write an array of widgets, generate them in a loop and handle the events in one callback function. I'm just starting to look into Java, so I'm only guessing. I believe even if GUI programming might be easier interfacing to your hardware (drives, cameras, whatever) might be harder in Java. I've myself a similar project on my todo list which keeps getting delayed again and again. I think I got as far a reading the serial number off of the camera :-( -- No intelligent man has any respect for an unjust law. He simply follows the eleventh commandment. -- R.A. Heinlein