We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
when I run the sketch below in Processing and press the window close button or ESC, then the text "run dispose method" is printed. In contrast to that, when I run the code in Eclipse as application, then the text output happens only, if I press ESC. The click on the window button close the program, but the text does not appear.
Why is the behavior different ?
Software versions: Processing (2.2.1), Eclipse (Luna), Win 7
I used the decription in creativeapplications.net/processing/craft-your-processing-sketches-in-eclipse/ to use the processing libaries in Eclipse. This does work without problems for many programs.
Processing test code:
void setup() {
size(200, 200);
registerMethod("dispose", this);
println("Start");
}
void draw() {
}
void dispose() {
println("run dispose method");
}
Eclipse Test Code:
package test;
import processing.core.*;
public class Test_Dispose extends PApplet {
public void setup() {
size(200, 200);
registerMethod("dispose", this);
println("Start");
}
public void draw() {
}
public void dispose() {
println("run dispose method");
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "test.Test_Dispose" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
Thanks for any hints.
Answers
I have tried the exported sketch now. It works like the program started from Eclipse.
Sorry.
With this information it lookslike this question: code-supposed-to-run-on-exit-does-not-work-when-exported
Are there new informations about that ?