XForms v0.81 Bug Report

Eric_Kischell@IUS5.IUS.CS.CMU.EDU
Mon, 02 Dec 96 11:28:41 EST

To subscribers of the xforms list from Eric_Kischell@IUS5.IUS.CS.CMU.EDU :

XFormers,

I have been developing an intraoperative surgical user interface
(IOS) using XForms v0.81 under IRIX 5.3 on a 24-bit display.

I have encountered the following "show-changing" bugs:

1) I have a form with two(2) pixmap objects which display
red/green "stop lights". At any given time the two objects
may point to the SAME pixmap data ie both red stop lights.
All was fine until I tried to free these pixmaps/objects.
If the two objects are freed when they point to the same pixmap data,
an X error(XFreePixmap) occurs. It looks as though XForms is trying
to free the same pixmap data twice. I have tried various
combinations of frees/locations to help support this conjecture.
My fix was to make sure that the two(2) objects point to different
pixmap data before freeing.

I am using the following Xforms API calls
(error checking omitted for brevity):

// read in pixmap data
pm1 = fl_read_pixmapfile( win, filename, &width, &height, &shape_mask, &hotx, &hoty, tran) ;
pm2 = fl_read_pixmapfile( win, filename, &width, &height, &shape_mask, &hotx, &hoty, tran) ;

// set pixmap in obj
ios_set_probe_viz_pixmap( obj_for, pm1 );
ios_set_probe_viz_pixmap( obj_curr, pm2 );
// change pixmaps
fl_set_pixmap_pixmap(obj, pm, 0);

// cleanup routine when done
void ios_pixmap_cleanup( FL_OBJECT *pm_obj_for, FL_OBJECT *pm_obj_curr,
Pixmap probe_viz_pm, Pixmap probe_not_viz_pm, FL_FORM *form)
{
if( form ){
if( form->visible )
fl_hide_form( form );
}

/* 999-- must force each object to different pixmap data or X exits with bad XFreePixmap() err. */
ios_set_probe_viz_pixmap( pm_obj_for, probe_viz_pm );
ios_set_probe_viz_pixmap( pm_obj_curr, probe_not_viz_pm );

ios_free_pixmap_pixmap( pm_obj_for );
ios_free_pixmap_pixmap( pm_obj_curr );

return;
}

2) When I tried to set a browser item to a color (@C3 -- Yellow),
an X color error ocurred when the box was scrolled the second time.
My fix was to just bold display the text.

fdui->br = fl_add_browser(FL_HOLD_BROWSER, SURG_PARM1_XVAL, SURG_PARM1_YVAL, SURG_PARM1_WVAL, SURG_PARM1_HVAL,"Probe Names");

sprintf(tmp_str, "@b%s rb#%d", map_str, probe_numbers[j]);
/* 999-- setting colour here caused an X err when box was scrolled(2nd time) */

fl_add_browser_line( obj, tmp_str );

Any explanations for these potential bugs would be appreciated.

Thanks,
e.-

To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html