[comp.windows.x] better interface to XtCallActionProc

grunwald@foobar.colorado.edu (Dirk Grunwald) (01/17/90)

Is there a better interface to XtCallActionProc, perhaps something
that parses the parameters as the translation manager would?

I've got a little menu package (EzMenu) that subclasses SimpleMenu and
smeBSBObject to call user-specified action procedures on a notify
event.

the action procedures are specified as part of the EzMenu ``menu''
resource, e.g.

*EzMenu*Menu:\
	(item "quit"\
		(label "This is Item One")\
		(action "quit()"))\
	 (line)\
	 (item "item2" \
		(label "This is Item 66")\
		(action "hi-mom(foo)"))\
	 (item "item3" \
		(label "This is Item Three")\
		(action "hi-mom(bar)"))\
	 (item "item4" \
		(action "hi-mom(baz)")\
		(label "This is Item 99"))


builds a menu of items with widget names "quit", "item2", .. etc
and the respective labels. The items are of class ezmeObjectClass

The intent is to call the ``action'' routine; the problem is that
XtCallActionProc wants the arguments parsed into parameters. E.g,

	foo(bar baz)

would call action proc ``foo'' with parameters bar & baz if specified
in a translation table, but it appears that I have to parse this myself.

If this is the case, I'm gonna revert to an infinitly easier (&
cheesier) specification of the action procedures: to wit, let TMparse
do it by specifying them as resources to the widgets of the
appropriate name.