In Phab I have a window called “editWin”. It is meant to be a pop-up window that shows up on top of a window called “baseWin”.
I create an internal link for editWin, and launch it in my code by calling
ApCreateModule(ABM_editWin, NULL, NULL );
It works fine.
Now there is an “Exit” button in baseWin. When that button is clicked, I want the pop up window to close as well. I think to close this window, I’m supposed to call
. So I added this function to my “Exit” button’s callback. However, the popup window is not closed. PtDestroyWidget seems to do nothing, even though my printf statement tells me it’s able to find the popup window with no problem.
To get around this problem, I set baseWin to be the parent window, so when baseWin exits, editWin also seems to exit automatically. I have two questions:
- Is my observation correct? If a parent window exits, any child window also is closed automatically? I just want to make sure it’s actually lurking somewhere, just not displayed.
- Why does PtDestroywidget not work?