# To subscribers of the xforms list from Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> :
>>>>> "Steve" == Steve Lamont <spl@ncmir.ucsd.edu> writes:
Steve> # To subscribers of the xforms list from Steve Lamont
Steve> <spl@ncmir.ucsd.edu> :
>> | 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.
JMarc
---------bug.c------------------------------
#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,
100,90,75,30,"Button");
fl_set_object_callback(obj, menu_callback, 1);
fl_set_object_shortcut(obj, "#BB", 1);
fl_end_form();
fl_show_form(form->pupform,FL_PLACE_CENTER,FL_FULLBORDER,"pupform");
fl_do_forms();
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);
fl_dopup(menu);
}
_________________________________________________
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 Jul 26 2000 - 05:05:46 EDT