comp.lang.ada
 help / color / mirror / Atom feed
* RE: What is the best Xwindow, window98 program to use frames with ada?
@ 1999-12-08  0:00 Carlisle, Martin
  1999-12-09  0:00 ` What is the best Xwindow, window98 program to use frames withada? Geoff Bull
  0 siblings, 1 reply; 7+ messages in thread
From: Carlisle, Martin @ 1999-12-08  0:00 UTC (permalink / raw)
  To: comp.lang.ada

There are several possibilities for a GUI for Ada for both Linux and
Windows.

#1) TASH (http://tash.calspan.com) -- uses Ada binding to Tcl/Tk
(http://www.scriptics.com)
#2) GtkAda (http://gtkada.eu.org) -- Ada binding to Gtk+ (GIMP toolkit).
See http://www.gtk.org for more info
#3) Java Virtual Machine (Intermetrics has an Ada to Java byte code
compiler.  Last I heard it was fairly out of date).  JGNAT (from ACT), is to
my experience quite a good product, but hasn't been released publicly yet.

Comparison:
Tcl/Tk is in my experience more stable on Win 32 than Gtk; however, Gtk has
better widgets.  GtkAda comes with a GUI builder (GLADE).  A GUI builder for
TASH, RAPID, (which also has a Gtk port in progess, and a completed JGNAT
port) is at http://wuarchive.wustl.edu/languages/ada/usafa/rapid/index.html.
Advantage of RAPID is that it is specifically an Ada product with the
ability to switch between graphics libraries, disadvantage is that it
doesn't fully utilize any one library.

I would STRONGLY recommend against using Win32Ada.  It very much ties you to
Windows, and requires you to code in a very C like fashion.  (Having written
AdaGIDE with Win32Ada, I have lots of experience, and hope to get rid of the
dependence some day).  You might also consider CLAW
(http://www.rrsoftware.com) if you want a nice Ada Windows-only binding.  

Good books:
Graphical Applications with Tcl & Tk (Foster-Johnson, M&T Books)
Developing Linux Applications with GTK+ and GDK (Harlow, New Riders)
Win32 Programming Bible (Vol 1 & 2) (Simon, Waite Group Press)

--Martin

PS.  WARNING:  As the author of this post is also the author of RAPID, his
opinions may be biased :-)

-----Original Message-----
From: Muller Boris [mailto:bomet@cybercable.fr]
Sent: Wednesday, December 08, 1999 12:26 AM
To: comp.lang.ada@ada.eu.org
Subject: Re: What is the best Xwindow, window98 program to use frames
with ada?


hehe well thank you to pin point this for me. I will definitely have no
excuse as how to translate ( in french) frame.
There are allways huge holes when you learn a language dynamically,and it's
allways good to face and clarify them.
As a matter of fact, your last answer was the good one. I'm in need of a GUI
for Ada.
And would like two things:
- a accomplished GUI for Ada
- that could be used under Linux and Microsoft Window ( I feel that this
point cannot be solved).
For now i've seen that there's win32ada, windex, and Gtkada. Which is the
best developped one?
Win32Ada seems the one.

Stephen Leake <Stephen.Leake@gsfc.nasa.gov> a écrit dans le message :
uzovms9dr.fsf@gsfc.nasa.gov...
> bomet <bomet@cybercable.fr> writes:
>
> > I'd like to begin using frames with ada.Have installed both under my
> > linux system and window98.
> > Anyone know what is the best tool for this use??
>
> You'll have to tell us what you mean by "frames" first.
>
> Do you mean the concept from artificial intelligence, where a "frame"
> is (loosely, I don't really do this stuff) a set of concepts defining
> a context for understanding other concepts?
>
> Or from robotics, where a "frame" is a Cartesian coordinate system
> allowing one to define vectors? (I used to do this a lot; I can send
> you some good Ada 83 code).
>
> Or from a non-standard extension to HTML, where a "frame" is a device
> that prevents users from bookmarking useful pages?
>
> Or from Graphical User Interfaces, where a "frame" is a sort of
> "window"? (See http://users.erols.com/leakstan/Stephe/Ada/windex.html
> for my stuff for Win32; www.adapower.com for more)
>
> -- Stephe



_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/cgi-bin/mailman/listinfo/comp.lang.ada








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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-08  0:00 What is the best Xwindow, window98 program to use frames with ada? Carlisle, Martin
@ 1999-12-09  0:00 ` Geoff Bull
  1999-12-09  0:00   ` Paul Hussein
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Bull @ 1999-12-09  0:00 UTC (permalink / raw)




"Carlisle, Martin" wrote:
> 
> There are several possibilities for a GUI for Ada for both Linux and
> Windows.

> #3) Java Virtual Machine (Intermetrics has an Ada to Java byte code
> compiler.  Last I heard it was fairly out of date).  JGNAT (from ACT), is to
> my experience quite a good product, but hasn't been released publicly yet.
> 

And you can integrate this with your native Ada code using JNI. See
http://www.acenet.com.au/~gbull




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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-09  0:00 ` What is the best Xwindow, window98 program to use frames withada? Geoff Bull
@ 1999-12-09  0:00   ` Paul Hussein
  1999-12-12  0:00     ` Geoff Bull
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Hussein @ 1999-12-09  0:00 UTC (permalink / raw)



Geoff Bull <gbull@acenet.com.au> wrote in message
news:384FA59B.3234C478@acenet.com.au...
>
>
> "Carlisle, Martin" wrote:
> >
> > There are several possibilities for a GUI for Ada for both Linux and
> > Windows.
>
> > #3) Java Virtual Machine (Intermetrics has an Ada to Java byte code
> > compiler.  Last I heard it was fairly out of date).  JGNAT (from ACT),
is to
> > my experience quite a good product, but hasn't been released publicly
yet.
> >
I would tend to agree. Write your GUI in Java and then use an automated
binding generator like JGNAT ADAJNI to generate a binding.

>
> And you can integrate this with your native Ada code using JNI. See
> http://www.acenet.com.au/~gbull






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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-12  0:00     ` Geoff Bull
@ 1999-12-11  0:00       ` Ed Falis
  1999-12-12  0:00         ` Paul Hussein
  0 siblings, 1 reply; 7+ messages in thread
From: Ed Falis @ 1999-12-11  0:00 UTC (permalink / raw)


In article <38524EC0.3283808A@acenet.com.au>,
  Geoff Bull <gbull@acenet.com.au> wrote:

> 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.

The approach I've used with AdaJNI is that since I have a copy of Visual Age,
I use its "visual composition editor" to create the UI, export the event
hooks and produce it as a Java Bean.  Then I have (had, actually - it's been
a while) a small bean launcher package written in native Ada code to load it
in as part of the setup of the application.

Since the most common stuff you wind up subclassing is gui classes, this was
a way to minimize the amount of Java code to write.

I've used a version of AdaJNI that supports 1.2 - I don't think it's released
yet, though.

- Ed



Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-09  0:00   ` Paul Hussein
@ 1999-12-12  0:00     ` Geoff Bull
  1999-12-11  0:00       ` Ed Falis
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Bull @ 1999-12-12  0:00 UTC (permalink / raw)


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




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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-11  0:00       ` Ed Falis
@ 1999-12-12  0:00         ` Paul Hussein
  1999-12-13  0:00           ` Geoff Bull
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Hussein @ 1999-12-12  0:00 UTC (permalink / raw)


It really depends on what you want to do.

I would go for writing the Ada part and the Java GUI part as separately as
possible, essentially writing the GUI as a stand-alone app, and the Ada as a
stand-alone app. Try to keep the message passing bit between the two as
simple as possible.

I think the previous posts were assuming a very tight integration design and
code-wise, and I would say that would be a very dangerous way to go. This
would require good tool support or a lot of code on your side. I would try
to make the interfacing as simple as possible. You could say pass strings.
Then you would need only a send message, and get/receive message interface.

You could then take the interfacing part that provides the mechanism for
passing these messages and implement it in JNI, sockets, shared mem,
whatever. Tight integration with a tool would be a mistake. Write it as much
as possible independant of the tool, and if you could do it without the
tool, so much the better. You coukd also reimplement the GUI in anything
else relatively easily, ( e.g. Win32, X ).

I managed to get an Ada main program to kick off a Java class in its own
thread running within a JVM and pass messages between the two, and it did
not take that long. All that is needed is native thread support in the Ada
compiler and the JVM, and no overlapping symbols in the java library and Ada
library.


Have you looked at using a GUI tool like BX Pro that can generate C, Java,
C++ for Win32 X or JDK. You may be able to create a GUI for most platforms
using X and C/C++ and for windows using Win32 and C/C++. If you write
standard interface code, when you generate the code, it should all work.

Ed Falis <falis@my-deja.com> wrote in message
news:82tn88$n2k$1@nnrp1.deja.com...
> In article <38524EC0.3283808A@acenet.com.au>,
>   Geoff Bull <gbull@acenet.com.au> wrote:
>
> > 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.
>
> The approach I've used with AdaJNI is that since I have a copy of Visual
Age,
> I use its "visual composition editor" to create the UI, export the event
> hooks and produce it as a Java Bean.  Then I have (had, actually - it's
been
> a while) a small bean launcher package written in native Ada code to load
it
> in as part of the setup of the application.
>
> Since the most common stuff you wind up subclassing is gui classes, this
was
> a way to minimize the amount of Java code to write.
>
> I've used a version of AdaJNI that supports 1.2 - I don't think it's
released
> yet, though.
>
> - Ed
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.






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

* Re: What is the best Xwindow, window98 program to use frames withada?
  1999-12-12  0:00         ` Paul Hussein
@ 1999-12-13  0:00           ` Geoff Bull
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Bull @ 1999-12-13  0:00 UTC (permalink / raw)




Paul Hussein wrote:
> 
> It really depends on what you want to do.

It always does, doesn't it?


> 
> I think the previous posts were assuming a very tight integration design and
> code-wise, and I would say that would be a very dangerous way to go. 

I wasn't necessarily assuming that. But why is this any more dangerous
than tightly coupling any gui to the backend?

>This
> would require good tool support or a lot of code on your side. I would try
> to make the interfacing as simple as possible. You could say pass strings.
> Then you would need only a send message, and get/receive message interface.

Fine, but that is not generally how people write gui interfaces,
not in my experience anyway. Well, actually I have seen this done
with a Java GUI talking through a socket to what was once a command
line application. 

> Tight integration with a tool would be a mistake. Write it as much
> as possible independant of the tool, and if you could do it without the
> tool, so much the better. 

Are you objecting to the use of a tool, or the tight integration?
Obviously not to the tool because you later sugest using
a tool (BX pro). As for tight integration, I'd say it depends
on the situation.

> I managed to get an Ada main program to kick off a Java class in its own
> thread running within a JVM and pass messages between the two, and it did
> not take that long. 

If you use Cafe1815 (see www.acenet.com.au/~gbull) this is trivial!


> 
> Have you looked at using a GUI tool like BX Pro that can generate C, Java,
> C++ for Win32 X or JDK. 

No, and I didn't see Ada in that list!?
A port of Rapid to JNI would be possible (just hack the JGNAT port),
but without a good binding generator it would be a *big* job.

> You may be able to create a GUI for most platforms
> using X and C/C++ and for windows using Win32 and C/C++.

Yes, but if you already have a Java (or GtkAda) GUI, why would
you bother?

Cheers
Geoff




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

end of thread, other threads:[~1999-12-13  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-08  0:00 What is the best Xwindow, window98 program to use frames with ada? Carlisle, Martin
1999-12-09  0:00 ` What is the best Xwindow, window98 program to use frames withada? Geoff Bull
1999-12-09  0:00   ` Paul Hussein
1999-12-12  0:00     ` Geoff Bull
1999-12-11  0:00       ` Ed Falis
1999-12-12  0:00         ` Paul Hussein
1999-12-13  0:00           ` Geoff Bull

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