XForms: [again] pup interaction bug?

From: Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
Date: Tue Sep 12 2000 - 04:07:34 EDT

  • Next message: j.w.c.a. lokin: "Re: XForms: [again] pup interaction bug?"

    # To subscribers of the xforms list from Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> :

    [Since I never got an answer on this bug, I post it again...]

    I have done a small example of a bug that have been plaguing LyX for a
    long time (file attached).

    In the following example (butchered from the demo popup.c), if you
    click on the button so that the menu appears, then clicking just to
    the right of the button fails to close the menu. This is a pain in LyX
    where the menu bar is a bunch of this buttons and opening 'Edit' when
    'File' is open is a real problem.

    Hope this one is helpful.


    #include "forms.h"

    typedef struct {
      FL_FORM *pupform;
      void *vdata;
      char *cdata;
      long ldata;
      FL_OBJECT *button;
    } FD_pupform;

    extern void menu_callback(FL_OBJECT *, long );

    FD_pupform *form;

    int main(int argc, char *argv[])
      FL_OBJECT *obj;
      fl_initialize(&argc, argv, 0, 0, 0);
      form = (FD_pupform *) fl_calloc(1, sizeof(*form));
      form->pupform = fl_bgn_form(FL_NO_BOX, 320, 250);
      obj = fl_add_box(FL_UP_BOX,0,0,320,250,"");
      form->button = obj = fl_add_button(FL_TOUCH_BUTTON,
      fl_set_object_callback(obj, menu_callback, 1);
      fl_set_object_shortcut(obj, "#BB", 1);
       return 0;

    /********* MENU ***********************************************/

    void menu_callback(FL_OBJECT *ob, long button)
      int menu = fl_newpup(FL_ObjWin(ob));
      fl_addtopup(menu, "Title%t");
      fl_addtopup(menu, "ABCabcabcabcabcabcabc%h", "A");
      fl_addtopup(menu, "DEFdefdefdefdefdefdef%h", "D");

      fl_setpup_position(form->pupform->x + ob->x,
                         form->pupform->y + ob->y + ob->h + 10);
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    This archive was generated by hypermail 2b29 : Tue Sep 12 2000 - 04:16:56 EDT