how to get visable msg after Closing window CB

Hello,
In the CloseWindowCB() function for a window in which I write an ini
configuration file I was hoping to give the user some feedback if I’m unable
to write the ini file by using PtNotice() or something similar but when I
call this function nothing gets displayed, the program just hangs, until I
hit the exit button again. I assume this is due to the PtMainLoop() being
exited already ?

Is there a way of doing this ?

Brett.

Brett Wilton <bdwilton@xtra.co.nz> wrote:

In the CloseWindowCB() function for a window in which I write an ini
configuration file I was hoping to give the user some feedback if I’m unable
to write the ini file by using PtNotice() or something similar but when I
call this function nothing gets displayed, the program just hangs, until I
hit the exit button again. I assume this is due to the PtMainLoop() being
exited already ?

Is there a way of doing this ?

The best way is to use the Pt_CB_WINDOW callback – it allows you to
decide not to close the window after all. It requires a little bit more
code but it’s all explained in the docs – search for Pt_CB_WINDOW and
then follow the “Notification callback” link.

The Pt_CB_WINDOW_CLOSING callback doesn’t necessarily mean that the
widget is being destroyed: it just tells you that the window is being
unrealized, very much like the Pt_CB_UNREALIZED callback. It’s posible
for a widget to get unrealized and then realized again – and if we ever
resurrect the “jumpgate” mechanism that Photon 1.14 had, your windows
may start unrealizing and re-realizing themselves even if your own code
doesn’t specifically ask for it.