This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building the GTK peers...


First of all, thanks for your pointers, Tom and Mark. 
Here is the final part of my AWT adventure...


Norman> "cannot load AWT Toolkit: gnu.java.awt.peer.gtk.GtkToolkit"
Norman> ... <stack trace deleted>
Norman> I seem to remember that there was some magic involved to
Norman> getting either the gtk or the Xlib peers built.

Tom > Can it even be done?  I don't remember the last time I tried it.

Yes, the peers can be built (see below). But they don't really work yet...


Mark> The default awt toolkit is wrong in gcj it is either
Mark> gnu.awt.gtk.GtkToolkit or gnu.awt.xlib.XToolkit. You should be able to
Mark> set the AWT toolkit used with -Dawt.toolkit=gnu.awt.gtk.GtkToolkit. 

Yes, -Dawt.toolkit=gnu.awt.gtk.GtkToolkit works, after building it.
Fixing the wrong default property should be easy for someone with
write access...

---

Here is what I did (without reading HACKING and before Mark told me
I really should use automake):

* Added the gnu.awt.gtk *.java files to Makefile.in 

* Fixed a few minor glitches, e.g.
  gnu.awt.gtk.GtkFramePeer:     missing (deprecated) insets() method 
 
* This was sufficent to build the Java part of what peers there were.

* Added gnu.awt.gtk *.cc to Makefile.in  (didn't work...,)
  Searching Makefile.in for clues...
  Added gnu.awt.gtk  *.lo  to Makefile.in  

* Current peers C++ code wants to include <gtk/gtk.h>, but SuSE 7.3 has
  /usr/include/gtk-1.2/gtk/gtk.h,  similar for gdk.h and glib.h
  
  Fixed by creating temporary symlinks in /usr/include
  As I don't know about Gnome and Gtk development, I am not sure whether
  SuSE or libjava are using the "correct" file system structure here.
  
* Now, compiling the C++ part of the Gtk peers worked fine

* Another hack to Makefile.in to convince libtool to link with gtk libs.

* got libgcj.a and libgcj.so


---


* Tried to run my app, NullPointerException in Container.add()

* Stacktrace has meaningless hexadecimal addresses. What is happening?
  
  Given that libgcj.so is around 50 MBytes non stripped, I had 
  expected useful Java source code linenumbers...
  
* Some more printf debugging in my code; the offending class tries
  to create a message console with two Buttons (ok) and a TextArea
  (not ok: no peer).
  
* "re-factored" my Console class; use of AWT is now optional.

* application compiles and runs!  (see next posting)


---

All in all, it looks like progress with AWT and the Gtk peers requires
people with knowledge in four areas: Java, AWT, Gtk, and "automake"...
This certainly reduces the number of applicants :-(

Perhaps someone of the automake wizards could prepare infrastructure
in Makefile.am, similar to the xlib stuff already there, so that 
bold souls could just enable Gtk during configuration?

- Norman


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]