Re: XForms: Free object draw and redraw problem

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 4 May 98 05:58:04 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Other objects like buttons and sliders just handed and not response
> when running. The free object is updated but overlap with the old
> one. Can somebody tell me why?

Tweeeeeeeet! Five code line penalty for misleading information! :-)

This is a different problem than the one you originally described.

You need to clear the drawing area -- it is *not* automagically
cleared for you. Here's what I do in a Free Object handler I use:

int freeobj_hduml_free_handle( FL_OBJECT *ob, int event,
FL_Coord mx, FL_Coord my,
int key, void *xev )

{

FL_EVENTS event_enum = ( FL_EVENTS ) event;

switch ( event_enum ) {

case FL_NOEVENT: {

break;

}
case FL_DRAW: {

/*
* Clear the drawing area.
*/

fl_drw_box( ob->boxtype,
ob->x, ob->y, ob->w, ob->h,
ob->col1, abs( ob->bw ) );

/* Do other drawing here */

break;

}
[...]

Two things of note:

First, I do not redraw the Free Object on the arrival any other event
than an FL_DRAW -- the manual specifically discusses this, I believe.

Second, note the fl_drw_box() function call. It clears the drawing
area in the Free Object to the appropriate background color and draws
the border.

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