[comp.windows.x.motif] XtCallCallbacks

nana@opal.bellcore.com (Ana M. Swanson) (04/03/91)

I've been having a problem with XtCallCallbacks.  I get this message:

    Warning: Cannot find callback list in XtCallCallbacks

when I run the following code. Am I using XtCallCallbacks erroneously?
Any ideas where I can find out more information on XtCallCallbacks - there
isn't much in the O'Reilly series nor the OSF/Motif manuals?

Thanks
Ana
                                \ O
---------------------------------X----------------------------------------------
                                / O
CODE in a procedure:

XmListCallbackStruct tmp_lcs;

tmp.item = XmStringLtoRCreate(widget1, XmSTRING_DEFAULT_CHARSET);
XtCallCallbacks(XmSelectionBoxGetChild (widget2, XmDIALOG_APPLY_BUTTON),
                XmNbrowseSelectionCallback,
                &tmp);



CODE in main program:

XtAddCallback(XmSelectionBoxGetChild(widget3, XmDIALOG_LIST),
	      XmNbrowseSelectionCallback, (XtCallbackProc) widget4, NULL);

slh@wolf.cs.washington.edu (Scott Heyano) (04/03/91)

In article <nana.670620351@opal> nana@opal.bellcore.com (Ana M. Swanson) writes:
[stuff]
|CODE in a procedure:
|
|XmListCallbackStruct tmp_lcs;
|
|tmp.item = XmStringLtoRCreate(widget1, XmSTRING_DEFAULT_CHARSET);
|XtCallCallbacks(XmSelectionBoxGetChild (widget2, XmDIALOG_APPLY_BUTTON),
|                XmNbrowseSelectionCallback,
|                &tmp);
	First your code (example) isn't consistant,
	you have tmp_lcs declared and not used and then reference tmp & widget2
	which are not declared.
	I think here (assuming widget2 is an XmSelectionBox) the callback
	is associated with the XmSelectionBox or XmList
	and not the apply button.
|
|
|
|CODE in main program:
|
|XtAddCallback(XmSelectionBoxGetChild(widget3, XmDIALOG_LIST),
|	      XmNbrowseSelectionCallback, (XtCallbackProc) widget4, NULL);
	Again it looks like you have real code problems,
	is widget3 suppose to be the same as widget2 above?
	is widget4 really suppose to be a function?
	Your adding the callback to the XmList child (which may or may not
	be necessary, you may be able to use the XmSelectionBox directly,
	I don't have the docs right here to check...)
	In any case your addding it to the XmList and trying to invoke it
	on the apply button above.