[XForms] trapping "close window" desktop manager button?

Angus Leeming angus.leeming at btopenworld.com
Sun Oct 10 13:19:00 EDT 2004


On Sunday 10 October 2004 5:33 pm, Michal Szymanski wrote:
> To subscribers of the xforms list
>
>
> Hi,
>
> When using a multi-form XForms application under any desktop
> manager that provides a title bar button for closing the window
> (usually something like X), it apparently kills the whole
> application which is often undesirable (especially when clicked on
> a "secondary" form window). Is there any portable (in terms of DM)
> way to trap such an action?
>
> regards, Michal.

Add this to the code that builds the dialog:
	fl_set_form_atclose(form_, C_WMHideCB, 0);

C_WMHideCB can do anything you like, but to simply close the dialog 
you'd write:

static int C_WMHideCB(FL_FORM * form, void * p)
{
        fl_hide_form(form);
        return FL_CANCEL;
}

Angus




More information about the Xforms mailing list