# To subscribers of the xforms list from Angus Leeming <a.leeming@ic.ac.uk> :
On Thursday 05 December 2002 1:34 am, Serge B Bromow wrote:
> # To subscribers of the xforms list from Serge B Bromow
> <serge@www.omensys.com> :
>
> Along the same topic, what signal is sent by the Window Manager
> when the close button is activated? I have tried to trap what I believe
> to be the most obvious signals without success.
Don't you both want
// Callback function invoked by xforms when the dialog is closed by the
// window manager.
extern "C"
static int C_WMHideCB(FL_FORM * form, void *);
int main()
{
FL_FORM * form = build_form();
fl_set_form_atclose(form, C_WMHideCB, 0);
fl_show_form(form, ...);
}
What you do in C_WMHideCB is, of course up to you. The important thing to
note is the return value. The documentation is quite good on this, or read
the source ;-)
Here, I have a child dialog that I want to close without shutting down the
other dialogs. CancelButton(), among other things, calls fl_hide_form().
extern "C"
static int C_WMHideCB(FL_FORM * form, void *)
{
// Close the dialog cleanly, even if the WM is used to do so.
lyx::Assert(form && form->u_vdata);
FormBase * ptr = static_cast<FormBase *>(form->u_vdata);
ptr->CancelButton();
return FL_CANCEL;
}
Regards,
Angus
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Thu Dec 05 2002 - 04:48:54 EST