Bug 21635 - GLib-GObject-WARNING with jython
Summary: GLib-GObject-WARNING with jython
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 0.18
Assignee: Thomas Fitzsimmons
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 21:43 UTC by Sandor Bodo-Merle
Modified: 2007-10-09 09:02 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-08-21 00:58:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandor Bodo-Merle 2005-05-17 21:43:40 UTC
executing the below code snippet in jython:

gcc version 4.0.1 20050508 (prerelease) (Debian 4.0.0-6)
Jython 2.1

import javax.swing as swing
win = swing.JFrame("JYTHON")
win.size = (100, 100)
win.show()

and closing the window from the window manager results in the following:

(.:29481): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in
cast to `GtkWidget'

(.:29481): Gtk-CRITICAL **: gtk_widget_hide: assertion `GTK_IS_WIDGET (widget)'
failed
 
Seems that the frames peer widget is destroyed. 
This - closing the window from the window manager, nad showing again - works 
with sun jdk 1.5_03.
Comment 1 Thomas Fitzsimmons 2005-08-21 00:58:01 UTC
I tried to run this under JamVM+Classpath:

$ jamvm -Dpython.home="/home/fitzsim/jython-2.1" -classpath
"/home/fitzsim/jython-2.1/jython.jar" "org.python.util.jython"
Jython 2.1 on java1.4.2 (JIT: )
>>> import javax.swing as swing
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named javax
>>> 

Any idea what I'm missing?
Comment 2 Sandor Bodo-Merle 2005-08-21 11:30:02 UTC
(In reply to comment #1) 
> I tried to run this under JamVM+Classpath: 
>  
> $ jamvm -Dpython.home="/home/fitzsim/jython-2.1" -classpath 
> "/home/fitzsim/jython-2.1/jython.jar" "org.python.util.jython" 
> Jython 2.1 on java1.4.2 (JIT: ) 
> >>> import javax.swing as swing 
> Traceback (innermost last): 
>   File "<console>", line 1, in ? 
> ImportError: no module named javax 
> >>>  
>  
> Any idea what I'm missing? 
>  
 Seems that jython cant make its cache directory - try adding something like 
this:   
-Dpython.cachedir="/tmp" 
Seems that this is not enough on my ubuntu machine and i have to add rt.jar to 
the classpath. I managed to fire up jamvm with the following: 
 
jamvm -Dpython.cachedir="/tmp" -Dpython.home="/usr/lib/python2.1" -classpath 
"/usr/share/java/jython.jar:/usr/lib/jvm/java-gcj/jre/lib/rt.jar" 
"org.python.util.jython" 
Jython 2.1 on java1.4.2 (JIT: ) 
>>> import javax.swing 
>>> 
 
 
Comment 3 Thomas Fitzsimmons 2005-08-21 15:12:21 UTC
I can't reproduce this on Classpath CVS HEAD.  Resolving as fixed.