Re: XForms: u_vdata

Steve Lamont (
Wed, 6 Aug 97 07:50:12 PDT

To subscribers of the xforms list from (Steve Lamont) :

> What I want is an array of obj passed to the callback:
> FL_OBJECT *obj[10];
> FL_OBJECT *but;
> obj[0] = fl_add_input(...);
> obj[1] = fl_add_input(...);

u_vdata can be a pointer to anything. So you can create your objects
as shown then do something like

but->u_vdata = ( void *) &obj[0];
but->u_ldata = n_objs


void button_callback_cb( FL_OBJECT *obj, long data )


FL_OBJECT **objs = ( FL_OBJECT **) obj->u_vdata;
int n_objs = obj->u_ldata;
int i;

for ( i = 0; i < n_objs; i++ )
printf( fl_get_input( objs[i] ) );



or whatever you wish.

Of course,

FL_OBJECT *obj[10];

had better be declared

static FL_OBJECT *obj[10];

or otherwise accessible (for example, declared in the routine where
you create your forms and call fl_do_forms()). Otherwise you may be
pointing out into Munchkinland when the callback is called and get
strange behavior or core dumps.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: