I am implementing a GUI application in Jython using the Eclipse and PyDev plugin. The problem is that it's hard for me to use the built-in debugger. When I start a debugging session, it just stops. Of course, this is to be expected, since the program simply creates a JFrame, and then it terminates.
So, any breakpoints that I put for different events. clicking the button will never happen because the debugging session is already completed.
What should I do? I'm tired of using fingerprints for all my debugging.
For example, when I tried to debug this little Java example. I have no problem with the breakpoint I set in windowClosing-method
import java.awt.event.*;
import javax.swing.*;
public class Test1 {
public static void main(String s[]) {
JFrame frame = new JFrame("JFrame Source Demo");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.setVisible(true);
}
}
jython
from javax.swing import JFrame;
import java.awt.event.WindowListener as WindowListener
class Test1 (JFrame, WindowListener):
def __init__(self):
super(JFrame, self).__init__('Some name goes here', defaultCloseOperation = JFrame.EXIT_ON_CLOSE, size = (800, 800))
self.addWindowListener(self)
self.setVisible(True)
def windowClosing(self, windowEvent):
print 'window closing'
pass
someFrame = Test1()
pass
jython , . , , someFrame windowClosing. - , , , , , .
- , ? , - .