Re: XForms: Getting a disabled pixmapbutton stippled. [and a new question]

From: Jean-Marc Lasgouttes (
Date: Wed Jul 26 2000 - 08:59:27 EDT

  • Next message: Raul Montoliu: "XForms: refresh problem"

    # To subscribers of the xforms list from Jean-Marc Lasgouttes <> :

    >>>>> "Steve" == Steve Lamont <> writes:

    Steve> # To subscribers of the xforms list from Steve Lamont
    Steve> <> :
    >> | However, it turns out that the buttons show up without their |
    >> shortcuts, but the shortcuts reappear if I move the mouse over the
    >> | buttons. Could you see a reason for that? | | In fact, it seems
    >> that, whenever I do a fl_redraw_form(form), the | shortcuts
    >> disappear. | | I'm using xforms 0.88.
    >> I see the same with xforms 0.89.

    Steve> Test code?

    I somewhat hoped that the description of the problem would give
    ideas... (I see two possible causes: either there is a place where
    buttons are drawn without shortcuts, or the shortcuts are drawn at a
    moment where a GC is badly initialized to the background color). As
    this is probably a compilcated interaction, it is very difficult to
    abstract the 80k lines of code of LyX to a simple example.

    I tried anyway. And I failed. However, my efforts have not been
    completely vain, since I have done a small example of a bug that have
    been plaguiing 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 or see
    XForms Home Page:
    List Archive:

    This archive was generated by hypermail 2b29 : Wed Jul 26 2000 - 05:05:46 EDT