[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OO approaches to GTK+




On Tue, 22 Jun 1999, Graham King wrote:

> Hi John
> 
> >I was kind of hoping that some people would tell some success stories of
> >how their favorite OO language integrates with GTK+ and these other libs.
> 
> Java (my favorite OO language and one that you mention you've been working
> with) integrates very nicely with GTK+... there's a Java class library in
> development that wraps the GTK via JNI.  It's not too far along the
> development path yet, but is functional enough to allow the 
> helloworld2.c source from the GTK tutorial to be coded in Java.  Not too
> useful but...

I think I would lean towards Python for simpler GTK+ apps, and then go to
a compiled language for larger projects.  While I think Java is great for
its thin-client, cross-platform, role I'm not sure that it is appropriate
here - both because you don't need the VM and because it's soo hard to
interface to C.

Trying to do OO with C connectivity is always a compromise, but I think
TOM strikes a good balance.  It offers better OO than Java, but is built
for native compilation.  It has GC.  It offers good support for Linux
tools and shared libraries.  It offers C connectivity by letting you use
html-ish tags to include C within TOM:

<doc>from Window.t </doc>
  instance (id)
    new int window_type
  {
    pointer p;
  <c>
    p = gtk_window_new (window_type);  
  </c>
    = [[self alloc] init p];
  }

For comparison, I've done the same app in C, TOM, and Java.  The C and TOM
versions use GTK+, the Java version is pure Java.

C:	http://www.primenet.com/~jjens/maze.c
TOM:	http://www.primenet.com/~jjens/Maze.t
Java:	http://www.primenet.com/~jjens/maze.html

I'm not really settled on TOM, but I do think it is a contender.

Best Wishes,

John






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]