Submitted by Anonymous on Tue, 04/15/2003 - 16:58.
What`s the best way to provide a callback for an `Exit` button? Is there a special ViewKit or window manager function that should be called here?
- Joel
Questions about motif? Contact us
Submitted by Anonymous on Tue, 04/15/2003 - 16:58.
What`s the best way to provide a callback for an `Exit` button? Is there a special ViewKit or window manager function that should be called here?
- Joel
Wed, 04/16/2003 - 00:14#1
ICS_support
Best practices in exit callbacks?
If you call exit(), everything goes away.
Or do you mean, what happens when the user clicks the "Close" button on the window manager menu?
Then, the application gets a WM_DELETE_WINDOW message, which should be handled appropriately, which may include exiting.
That said, I usually don`t call exit() but instead set a flag which I check for in the main loop; then I can unwrap properly and clear other server resources. I can also check for memory leaks there, before exiting. The programs over in the tips area use this style; see an example in http//www.motifzone.net/tnt/tips_code/dialog_popup.c .
Wed, 04/16/2003 - 11:31#2
Anonymous
Best practices in exit callbacks?
Do you have a c++ example for this?