Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Problem with asciiTextWidget callback Message-ID: <9005071524.AA15637@expo.lcs.mit.edu> Date: 7 May 90 15:24:31 GMT References: <9005062345.AA03834@aps2.spa.umn.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: X Consortium, MIT Laboratory for Computer Science Lines: 39 > I am trying to register a callback with the asciiTextWidget. I create > the widget, then add a callback with XtAddCallback. > > When I execute the code, I get a message: > > Warning: Cannot find callback list in XtAddCallbacks The Athena asciiText widget is composed of the Text, AsciiSrc, and AsciiSink widgets. The callback resource of the asciiText widget is actually a resource of the AsciiSrc widget (noted under "callback" in section 5.5.1). When XtAddCallback is called, no callback resource is found in the asciiText widget, so your callback is not registered. Section 5.5 explains that these resources which actually belong to the AsciiSrc or AsciiSink can be set via XtSetValues, or at widget creation time (i.e. with XtCreateManagedWidget). So, the following will work: static XtCallbackRec cb[] = { {Text_Callback, (XtPointer) NULL}, {(XtCallbackProc) NULL, (XtPointer) NULL} }; top = XtInitialize (argv[0],"TEst", NULL, 0, &argc, argv); string = XtVaCreateManagedWidget ("string", asciiTextWidgetClass, top, XtNstring, "test", XtNeditType, XawtextEdit, XtNcallback, cb); Donna Converse converse@expo.lcs.mit.edu