Re: XForms: Problem with freeobject coords in v0.88

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 15 Jan 98 17:44:20 PST

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

> I have struck a possible problem in upgrading to v0.88 from 0.86 (SGI
> Irix 5.3). The only change I made is for a free object that I was
> adding manually under 0.86 to be now included using fdesign (as free
> objects are supported in fdesign of 0.88). ...
> [...]
> E.g., the add_free command generated from fdesign is:
>
> fdui->plotfreeobj = obj =
> fl_add_free(FL_NORMAL_FREE,760,90,190,310,"",
> freeobj_plotfreeobj_handle);
>
> and this is consistent with what I was doing manually in v0.86, but the
> following command issued in the handler:
>
> printf("ob->x=%d ob->y=%d ob->w=%d ob->h=%d \n",
> ob->x,ob->y,ob->w,ob->h);
>
> produces
> x=90 y=190 w=310 h=3
>
> Somehow the values have changed (note width and height are incorrect
> too), but as mentioned earlier, not in terms of detecting events
> etc. ...

Are you absolutely sure you've got the 0.88 header file (forms.h)
installed and that's the one you're getting when you compile?

The 0.86 FL_OBJECT looks like

typedef struct flobjs_
{
struct forms_ *form; /* the form this object belong */
void *u_vdata; /* anything user likes */
long u_ldata; /* anything user lines */

int objclass; /* class of object, button, slider etc */
int type; /* type within the class */
[...]

whereas the 0.88 FL_OBJECT looks like

typedef struct flobjs_
{
struct forms_ *form; /* the form this object belongs to */
void *u_vdata; /* anything the user likes */
char *u_cdata; /* anything the user likes */
long u_ldata; /* anything the user likes */

int objclass; /* class of object, button, slider etc */
int type; /* type within the class */
[...]

Note that there's an extra field (u_cdata) in 0.88's FL_OBJECT
definition. This would explain the shift of the dimensions, which are
defined later on in the structure.

If you have any precompiled functions or libraries which haven't been
rebuilt since 0.86, you'll need to rebuild them, too, since they will
probably do something strange if you reference any of the members of
the FL_OBJECT or FL_FORM structures, as well as possibly others.

BTW, a note to TC: if possible, it'd be nice if the user could specify
the name of the free object handler in fdesign.

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://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/