// legacy
static A onWindowClosing(A w, O r) {
ret onWindowClosing(w, toRunnable(r));
}
static A onWindowClosing(A w, Runnable r) {
if (w != null) swing {
w.addWindowListener(new WindowAdapter {
public void windowClosing(WindowEvent e) {
temp tempRememberListener(w, 'removeWindowListener, this);
pcallF(r);
}
});
}
ret w;
}
static A onWindowClosing(Runnable r, A w) {
ret onWindowClosing(w, r);
}