Re: XForms: Arrays of Object names

Steve Lamont (spl@szechuan.ucsd.edu)
Sun, 24 Oct 99 10:28:18 PDT

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

> I'm using arrays of objects ( object[0] object[1] etc.. )
> within a form, and it works well. However, when I extend the array object
> naming across forms, I get multiple definition problems (with fdesign)
> in the .h and .c xforms files, as the separate forms FL_FORM are defined
> separately.

Hm. I'm not sure I understand what you're trying to say. Can you
give a more concrete example? If the structure typedefs are different
there should be no difference. For instance.

/**** Forms and Objects ****/
typedef struct {
FL_FORM *try0;
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *xyplot[8];
} FD_try0;

extern FD_try0 * create_form_try0(void);
typedef struct {
FL_FORM *try1;
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *xyplot[8];
} FD_try1;

extern FD_try1 * create_form_try1(void);

> I know this sounds a crazy wish, but I have 16 xyplots, which
> don't fit well into a normal screen, so I wanted to split it up as 2
> forms, each with 8, for deparate display, or display together, and
> wanted to refer to them all globally with xyplot[0] to xyplot[15]

I suppose what you could do is to create an array of pointers:

FD_try0 *fd_try0;
FD_try1 *fd_try1;
FL_OBJECT *xyplot[16];

fd_try0 = create_form_try0();
fd_try1 = create_form_try1();

[...]

xyplot[0] = fd_try0->xyplot[0];
[...]
xyplot[7] = fd_try0->xyplot[7];

xyplot[8] = fd_try1->xyplot[0];
[...]
xyplot[15] = fd_try1->xyplot[7];

Or am I missing something?

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/