Re: XForms: Window Managers close button

ian (ian@eonsw.demon.co.uk)
Mon, 19 Oct 1998 21:17:39 +0100 (BST)

# To subscribers of the xforms list from ian <ian@eonsw.demon.co.uk> :

On 19-Oct-98 Lothar Esser wrote:
># 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.

Indeed it does - thanks.

> Lothar Esser

--
Ian

Ian Leonard

eMail: ian@eonsw.demon.co.uk Phone Fax: +44 (0)1865 434757 Fax: +44 (0)1865 434758 19 Stapleton Road Headington, Oxford, OX3 7LX, UK

Please ignore spelling and punctuation - I did. _________________________________________________ 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/