@Eran: please allow the event handler to cancel an operation.
What I mean is, you send events before page changes, after it changes and before it closes. But right now, they 're just informational events, i.e. just letting us know what is going to happen.
But we should be able to say to wxFlatNotebook: "hey, do not close this page, it's not saved yet"
Fortunately, this is easy. Just add the following couple of lines after posting the message:
// the event handler allows it?
if (!event.IsAllowed())
return;
I have already added it in my copy but it will be a pain to merge these after every update...