Re: [gtk-list] Java + GTK project




There was a person developing a Java interface for GTK+ and GNOME, but the
project never got very far. I had the source for awhile, but I seem to
have gotten rid of it recently. The project was called Java-Gnome, or
something like that. Look on www.gnome.org and try to track it down. Don't
be turned off by the name though; at the time I looked at it, he hadn't
begun developing any GNOME interfaces yet, only GTK+. I don't recall much
about the design, so I can't comment on that.

Regards,
   Cody Russell  <bratsche@dfw.net>

On Fri, 9 Jul 1999, Nathan Oliver John Whitehead wrote:

> 
> Hello everyone,
> 
> I am new to this list.  Recently I have been learning both GTK and Java,
> so my latest project involves getting them to work together.  I have
> decided to use JNI for interfacing to GTK, so my library requires
> JDK-1.2.  Has anyone else already done all this, and if so, where can I
> find it?  If not, is anyone else currently working on a project similar
> to this so we could collaborate?
> 
> My project is called JGTK, or Java with GTK (any suggestions for a
> better name?) and will be released under the LGPL.
> 
> 
>  -= Project Goals =-
> 
> 1)  Be as simple an interface between Java and GTK as possible.  An
> object-oriented wrapper may be constructed on top of this basic
> interface, probably modelled after Swing.
> 
> 2)  Implement as much functionality of GTK as possible.
> 
> 3)  Include full documentation, both in the source code explaining the
> technical aspects of the library, and as Javadoc comments in the
> interface description.  This way a full HTML reference manual for the
> library can be constructed using javadoc.
> 
> 4)  Be extensible, so as new versions of GTK come out minimal changes
> are required to the library.
> 
> 
>  -= Basic Ideas =-
> 
> The basic idea is that JGTK uses handles (integers) to represent
> pointers to widgets.  For example, a Java program executes
> 
> long button;
> button = button_new_with_label("click me")
> 
> and button gets assigned an integer that represents an ID into a
> hashtable kept by JGTK.  This integer is then used anytime a pointer to
> that button is required.  All objects are kept in this hashtable.
> 
> To generate the JNI definitions, I use a parser program to parse a text
> file with descriptions of each function.  The parser program then
> generates both the Java interface file and the C implementation file
> from the same source.  Hopefully this will make it easy to add functions
> and keep things synchronized.
> 
> 
>  -= Current Status =-
>  
> After getting JNI to work and learning how to use GTK, I went through
> the tutorials and tried to make each tutorial work with JGTK.  Right now
> I am at part 9.2, dealing with arrows.  Pretty much everything up to
> that point works.
> 
> Signal handling is different because Java does not allow pointers to
> functions.  Instead a reference to an object is passed to
> signal_connect, and then when an event occurs, the method eventHandler
> of that object is called.  Currently both GTK and GDK signals are
> supported, but no parameters except a single user-specified integer.  So
> applications receive "motion_notify_event", but cannot discover the
> mouse coordinates.
> 
> Right now I am working on entering functions into my parse file to
> support more widgets and more functions for each widget.  For each
> function that I add, I am also writing a description in javadoc style. 
> Also, many functions require enums as arguments, so I am putting these
> constants into a separate class as I need them.
> 
> If you would like to help me with JGTK, please email me at
> whitehno@whitman.edu.  As soon as I get things packaged up a little
> better, I will post what I have so far on my webpage at
> people.whitman.edu/~whitehno.  Any ideas for the library are welcome,
> nothing is set in stone yet.  Anyone with experience with autoconf is
> welcome to help with a configure script!
> 
> -Nathan
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 



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