XForms: Multiline Browser Behaviour

Dick Middleton (dick@sqf.hp.com)
Thu, 19 Jun 1997 09:32:56 +0100

To subscribers of the xforms list from Dick Middleton <dick@sqf.hp.com> :

This rather unsavory little program demonstrates what seems to me to be
incorrect behavior of the mutiline browser.

If the select callback takes some time then lines over which the *unpressed*
mouse pointer has passed during the callback time are also selected.

Some users may have seen this effect (with normal callback times) but put it
down to poor mouse driving!

So, select a line, release the mouse and move the pointer down a line or two.
Then wait. The select callback has a sleep(1) (to exaggerate the effect) so
it takes a little while!

dick

--

dick @sqf.hp.com

#include "forms.h" #include <stdlib.h>

typedef struct { FL_FORM *debug; void *vdata; long ldata; FL_OBJECT *browse; } FD_debug;

void debugCB(FL_OBJECT *obj, long data) { if (data) sleep(1); else exit(0); }

FD_debug *create_form_debug(void) { FL_OBJECT *obj; FD_debug *fdui = (FD_debug *) fl_calloc(1, sizeof(*fdui));

fdui->debug = fl_bgn_form(FL_NO_BOX, 320, 250); obj = fl_add_box(FL_UP_BOX,0,0,320,250,""); obj = fl_add_button(FL_NORMAL_BUTTON,110,210,60,30,"Quit"); fl_set_object_callback(obj,debugCB,0); fdui->browse = obj = fl_add_browser(FL_MULTI_BROWSER,30,20,250,140,""); fl_set_object_callback(obj,debugCB,1); fl_end_form();

fdui->debug->fdui = fdui;

return fdui; }

void main(int argc, char **argv) { FL_OBJECT *obj; int ii;

Display *display = fl_initialize(&argc, argv, "Debug", 0, 0);

FD_debug *D_debug = create_form_debug();

for (ii = 0; ii < 10; ii++) fl_addto_browser(D_debug->browse, "another line");

fl_show_form(D_debug->debug, FL_PLACE_POSITION, FL_FULLBORDER, "Debug");

while (1) { obj = fl_do_forms(); }

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