Re: XForms: Window Managers close button

Lothar Esser (esser@chop.swmed.edu)
Mon, 19 Oct 1998 10:37:43 -0500 (CDT)

# To subscribers of the xforms list from Lothar Esser <esser@chop.swmed.edu> :

On Mon, 19 Oct 1998, AMIT BHATNAGAR wrote:

> > What is the correct way to handle this situaltion?
> >
> > I have a form. The form opens another form (for a password as it happens). If
> > the close button on the window managers title bar is clicked (on the password
> > form) the whole application dies.
> >
> > What I need to do is to trap the event (whatever it is) and close just the form.
> >
> > TIA.
>
> when you say close button, do you mean a button that you created to close
> the form, OR the X button on the Xwindow that closes the window?
>
> I suggest that you creater a button on the password form called close or
> submit or whatever, and have its callback fl_hide_form (obj->form);
> fl_free_form (obj->form)... and thats all there is to it.
>

You can also use fl_set_form_atclose(Passwordform, close_cb, "1")
Where close_cb is

int close_cb (FL_FORM *frm, void *data) {
return(FL_OK);
}

This will close the form without killing the whole application. If you
need to do something else before the form is closed you can do that within
this function too.

Hope this helps.

Lothar Esser

------------------------------------------------------------------
Dr. Lothar Esser
Howard Hughes Medical Institute
5323 Harry Hines Blvd.
Dallas Texas 75235-9050
E-mail : esser@chop.swmed.edu
------------------------------------------------------------------

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/