Re: XForms: Don't want closing one form to close all

From: myaconis@nlxcorp.com
Date: Wed Dec 04 2002 - 23:27:08 EST

  • Next message: Nicolas Castagne: "XForms: Windows placement"

    # To subscribers of the xforms list from myaconis@nlxcorp.com :

    I appreciate this question because I am currently modifying an application that will suffer from the same problem.  The following seems to work effectively.

    When creating the transient form I registered a raw callback

    fl_register_raw_callback( form,
                             FL_ALL_EVENT,
                             raw_routine_cb );

     

    The routine is


    int raw_routine_cb( FL_FORM *form, void *xev )
    {
      int type = ((XEvent *)xev)->type;

       printf("Got an %d event!\n", type);
     
      if (type == ClientMessage)
      {
         printf("Got an %d event! ClientMessage\n", type);
         //do whatever you need to do to close the

          //the transient window
         return FL_PREEMPT;
      }

       return 0;
    }

    > The server generates an UnmapNotify event when a window changes state
    > from mapped to unmapped.

    On my Redhat Linux 7.2 machine (using KDE) I noticed minimizing the form generated the UnmapNotify event but closing the form from the exit button on the border generated a ClientMessage event.  By capturing this event and preempting further handling of it, the "main" application remains open.

    Perhaps the FL_ALL_EVENT is overkill but I wasn't sure if just the ButtonPress and ButtonRelease Masks would do the trick... perhaps I'll fool around with that some.

    (Sorry about the HTML encoded email...my Lotus Notes Mail web client can be a pain!)

    Steve Lamont <spl@ncmir.ucsd.edu>
    Sent by: owner-xforms@bob.usuhs.mil
    12/04/2002 06:41 PM PST
    Please respond to xforms

    To: xforms@bob.usuhs.mil
    cc:
    bcc:
    Subject: Re: XForms: Don't want closing one form to close all


    # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :

    > 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.

    By "signal" I assume you mean XEvent.  They're different critters.

    The server generates an UnmapNotify event when a window changes state
    from mapped to unmapped.

    spl

    _________________________________________________
    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/

    _________________________________________________ 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 : Wed Dec 04 2002 - 23:26:00 EST