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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e092a534485c39a1 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: What is the best Xwindow, window98 program to use frames withada? Date: 1999/12/12 Message-ID: <38524EC0.3283808A@acenet.com.au>#1/1 X-Deja-AN: 559344957 Content-Transfer-Encoding: 7bit References: <9BBB0C9AF506D311A68E00902745A537BB86C3@fsxqpz04.usafa.af.mil> <384FA59B.3234C478@acenet.com.au> <82p3sp$cds$1@lure.pipex.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 944918310 203.35.118.1 (Sun, 12 Dec 1999 00:18:30 EST) Organization: Customer of Telstra Big Pond Direct MIME-Version: 1.0 NNTP-Posting-Date: Sun, 12 Dec 1999 00:18:30 EST Newsgroups: comp.lang.ada Date: 1999-12-12T00:00:00+00:00 List-Id: I assume you are talking amount interfacing native Ada to Java on a JVM. Paul Hussein wrote: > Write your GUI in Java and then use an automated > binding generator like JGNAT ADAJNI to generate a binding. ^^^^^ But JGNAT is a compiler for Ada targetting JVM. It happens to come with a binding generator, but this (presumably, I haven't seen it) will only produce bindings suitable for compiling with JGNAT. Apart from the obviously difficulties that it's bindiings don't talk JNI, a lot of Java classes are only useful once you inherit from them. Thus you need to write Java code to do this inheritance and the call native methods. However, you'll find that most such methods are trivial and since you are writting some Java, you may as well write a bit more (easier than mucking around with the binding generator). Soon you find you whole GUI is written in Java. This is not necessarily a bad thing, I happen to think that is one of the few things for which Java is particularly good. I have worked out a way to avoid writing any Java code (just have the native code generate the required Java byte code) but I haven't got around to implementing this yet. Also, if you have JGNAT, there is absolutely no reason to write your GUI in Java (apart from your boss telling you to). AdaJNI doesn't interest me because, among other things, it costs money, it's not open source, it doesn't have JDK 1.2 support (at least, I don't think so), and the way it handles events is not (IMO) the best way to do it (but they have a product and I don't!). I have been working on a Javadoc based binding generator, and it seems to be that the requirements for a native binding working through JNI with no Java specific compiler support are a bit different to the requirements for JGNAT. Nevertheless, when JGNAT becomes public I might see if I can't bend it to generate bindings that work with JNI. (My Javadoc generator works, in a limited sense, but Javadoc (Windows?) really chokes on swing on a PC with only 64MB). The real problem with using thin JNI is that it is unsafe. I.e. It is easy to pass a wrong argument and this, apart from being difficult to debug, usually blows up the JVM (that is better than blundering on). Of course, it is not hard to hand build type safe bindings on top of JNI, so long as you don't need too many and you don't need iheritance.The next version of Cafe1815 has some generic packages (built to support my "grinder" binding generator) that make this a bit (a lot!) more palatable. Cheers Geoff