Re: XForms: Suspected Xforms.88 memory bug

Donald B Owens (d.b.owens@larc.nasa.gov)
Mon, 30 Mar 1998 15:07:42 -0500 (EST)

# To subscribers of the xforms list from Donald B Owens <d.b.owens@larc.nasa.gov> :

I have recently upgraded from 86 to 88 and now have a problem with drawing.
I draw to a generic object that was made with the following:

ob = fl_make_object(FL_JWIN,type,x,y,w,h,label,handle_jwin);

The problem I am having is that the FL_RELEASE event is not being sent to the
appropriate call backs (e.g. : void jw_b1_default_cb(FL_OBJECT *ob, int
event, FL_Coord mx, FL_Coord my) )
EVERYTIME I release the mouse button after a draw. The FL_RELEASE event is
only sent after a number of draws are made. In other words, it looks like it
is
buffering the release events and then sending them all at once. I had no
problem with this when using version 86. Has something changed?
I could not find anything in the prior emails for this problem.

Any suggestions?

Platform SGI IRIX 6.2.

Thanks for the help in advance.

Below is the function that uses the FL_RELEASE event

void jw_b1_default_cb(FL_OBJECT *ob, int event, FL_Coord mx, FL_Coord my)
{
static FL_Coord sx=0,sy=0,ox=0,oy=0;
switch (event) {
case FL_PUSH:
sx=ox=mx;
sy=oy=my;
break;
case FL_MOUSE:
if (! MULTIVIEW) {
fl_drawmode(GXxor);
fl_set_clipping(ob->x+ob->bw,ob->y+ob->bw,ob->w-2*ob->bw,ob->h-2*ob->bw);
fl_rect(sx,sy,ox-sx,oy-sy,ob->col2);
fl_rect(sx,sy,mx-sx,my-sy,ob->col2);
fl_drawmode(GXcopy);
ox=mx;
oy=my;
fl_unset_clipping();
}
break;
case FL_RELEASE:
if (! MULTIVIEW) {
if ((abs(mx-sx) > 3) && (abs(my-sy) > 3)) {
if (OB->xrev) {
OB->minmax[OB->xaxis][2] = (mx > sx) ?
OB->xoff-(mx-ob->x-10)/OB->scale
:
OB->xoff-(sx-ob->x-10)/OB->scale;
OB->minmax[OB->xaxis][3] = (mx < sx) ?
OB->xoff-(mx-ob->x-10)/OB->scale
:
OB->xoff-(sx-ob->x-10)/OB->scale;
} else {
OB->minmax[OB->xaxis][2] = (mx < sx) ?
(mx-ob->x-10)/OB->scale+OB->xoff
:
(sx-ob->x-10)/OB->scale+OB->xoff;
OB->minmax[OB->xaxis][3] = (mx > sx) ?
(mx-ob->x-10)/OB->scale+OB->xoff
:
(sx-ob->x-10)/OB->scale+OB->xoff;
}
if (OB->yrev) {
OB->minmax[OB->yaxis][2] = (my < sy) ?
OB->yoff-(ob->h-(my-ob->y)-10)/OB->scale
:
OB->yoff-(ob->h-(sy-ob->y)-10)/OB->scale;
OB->minmax[OB->yaxis][3] = (my > sy) ?
OB->yoff-(ob->h-(my-ob->y)-10)/OB->scale
:
OB->yoff-(ob->h-(sy-ob->y)-10)/OB->scale;
} else {
OB->minmax[OB->yaxis][2] = (my > sy) ?
(ob->h-(my-ob->y)-10)/OB->scale+OB->yoff
:
(ob->h-(sy-ob->y)-10)/OB->scale+OB->yoff;
OB->minmax[OB->yaxis][3] = (my < sy) ?
(ob->h-(my-ob->y)-10)/OB->scale+OB->yoff
:
(ob->h-(sy-ob->y)-10)/OB->scale+OB->yoff;
}
}
fl_redraw_object(ob);
}
break;
}
}

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