Re: XForms: getting the name of a form

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 5 Jun 98 12:01:50 PDT

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

> is there any way of obtaining the name of the form from an object passed
> down to a callback?

typedef struct forms_
{
void *fdui; /* for fdesign */
void *u_vdata; /* for application */
char *u_cdata; /* for application */
long u_ldata; /* for application */

char *label; /* window title */
unsigned long window; /* X resource ID for window */
[...]
}
FL_FORM;

The label is the closes there is to a "name" of the form. You could
also use the u_cdata field to hang a "name" onto.

> When i receive an object in a callback, I want to preform different
> functions depending on which form the object belonged to.
>
> I don't want to have a different callback for each form. ...

Why? What possible advantage could there be to consolidating
callbacks into one in this case. You either have a large number of
callbacks or you have giant, ugly, switch statments.

You're just creating a large amount of extra work for yourself. I've
experimented with the single callback _modus operandi_ and it's
frankly just not worth the trouble.

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/