Re: SWT library versions

Kevin Reid <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
>> I seem to recall you knew a swt library upgrade was needed -- ?
>
> I don't recall that but I'm not surprised. Do you know what version  
> we need? Should we just grab the latest?

I don't have any information on that. What I did dig up since then is  
that there is a bug in the -XstartOnFirstThread mode, which is needed  
for Mac SWT:

http://lists.apple.com/archives/java-dev//2008/Feb/msg00179.html

I added this fix to the beginning of Rune#main and it stopped exiting  
silently -- instead it gets to the point of having a menu bar, but  
hangs instead of responding to events.


I tried downloading newer SWT versions (3.3.2 and 3.4), but the  
behavior did not change.

(By the way, the swt.jar is architecture-independent, so we shouldn't  
have two copies in mac/ppc/ and mac/x86/. If I upgrade it I'll put it  
in bin/mac/ and symlink from the arch directories -- or should I  
revert the change (which I didn't write) that looked for swt in arch- 
specific dirs?)

Index: src/jsrc/org/erights/e/elang/interp/Rune.java
===================================================================
--- src/jsrc/org/erights/e/elang/interp/Rune.java	(revision 505)
+++ src/jsrc/org/erights/e/elang/interp/Rune.java	(working copy)
@@ -312,6 +312,14 @@
       *
       */
      static public void main(String[] argArray) {
+
+        // workaround for bug in Mac OS X Leopard Java - 
XstartOnFirstThread (needed for swt); from http://lists.apple.com/archives/java-dev//2008/Feb/msg00179.html
+        {
+            final Thread t = Thread.currentThread();
+            if (t.getContextClassLoader() == null) {
+                 
t.setContextClassLoader(ClassLoader.getSystemClassLoader());
+            }
+        }

          final TextWriter errs =
            new TextWriter(PrintStreamWriter.stderr(), true);


-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.