When a PtWindow is built with these resources set:
Ph_WM_RENDER_TITLE, Ph_WM_RENDER_CLOSE, and Ph_WM_CLOSE
you get the friendly red X in the window’s upper right hand corner.
Click on it and the window closes as expected.
Question: What is the built-in callback that accomplishes this? Code
details, if possible.
Background for the curious:
I’m implementing a PhAB application that has compiled-in windows but
also invokes another widget from a DLL using the dlopen() and dlsym()
calls.
We need a much larger “close window” button because user will probably
be wearing gloves. In the main app, I use a big button whose
“activate” callback is the handy “Done:” or “Cancel” option. But
when trying to implement such a button in the DLL-based window, the
“Done” callback closes everything. However, the “native” close
widget (little red X, upper RH corner) works as I would like.
Even more detail:
I tried implementing a big-close-button callback using
PtForwardWindowEvent() with an event of Ph_WM_CLOSE after finding the
region ID of the button’s parent window. This did not work in the
DLL-based window. A variation of this technique (Ph_WM_HELP) used in
the main PhAB app does work – but, again, not in my DLL widget.