I have an application that uses popup shells. I manage the window up using XtPopup and XtPopdown. It works fine if, for example, I attach a callback to a button to pop the window up and down. However, I'm trying to overload the "Close" button in the upper left hand corner using a protocol atom (WM_DELETE_WINDOW). Whenever the protocol callback gets invoked (it is the SAME callback I use for the button), it corrupts the contents of my shell widget (shell_widget.core.self become garbage, and shell_widget.core.parent becomes NULL). The next time I try to pop the window up using XtPopup, it core dumps. I have it narrowed down to a very simple test program and the behavior (to my surprise) is very repeatable. I'm not sure if I'm using the protocol atoms incorrectly or what. Here is how I set up the protocol atom (note - gShell is what was returned from XtVaCreatePopupShell): // add a callback for the WM_DELETE_WINDOW protocol (close button) Here is the callback that I invoke via the protocol atom (and from a button on my top level which does work fine): extern void HideNotify( Widget wid, XtPointer client_data, if ( true == show_text ) show_text = false; show_text = true; Thanks! |
|||

jwobido
XtPopup core dumping when used with protocol atoms
Nevermind - I figured out the problem. I need a call to XmAddWMProtocols(). Funny thing is, our software that uses protocols has never had a problem without this call.