Clicklistener of window close button

Hi,

Is there a way to override the clicklistener of the window close button?

Thanks,
Daniccan VP

window.removeCloseListener(toRemove);
window.addCloseListener(newCloseListener);

what is the listener that i have to add to “toRemove”. Am not able to get the default clicklistener of the window close button. And if I am not wrong, is close listener not supposed to be called after the window is closed? My requirement is to override the listener which is called before the window is closed (i.e., when the close button is clicked.).

What do you mean by
default clicklistener?

To be more clear, I want to override the functionality of closing a window.

So, maybe try to override
close()
method?