Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!imp!diablery.10A.com!devil From: devil@diablery.10A.com (Gil Tene) Newsgroups: comp.windows.x Subject: Xaw AsciiText XtAddCallback ?? Message-ID: <341@imp.UUCP> Date: 15 May 91 20:31:43 GMT Sender: devil@imp.UUCP Organization: Diablery, cloud seven, Hell. (also 10A Inc.) Lines: 45 Nntp-Posting-Host: imp Hello X'ers, I was trying to specify a callback funtions for a Xaw AsciiText, and found this "strange" behaviour : When trying to specify the callback using : XtAddCallback(text1, XtNcallback, MyTextCBhandler, (XtPointer) &text_data1); I get a "Warning: Cannot find callback list in XtAddCallbacks" at runtime, and the callback doesn't work... BUT: when I specify an explicit callback list during the creation of the asciiTextWidget, it works... (took me a while to think of trying it this way) : static XtCallbackRec text_callback_list[] = { {MyTextCBhandler, (XtPointer) NULL}, {(XtCallbackProc) NULL, (caddr_t) NULL} }; . . . XtSetArg(args[0], XtNstring, "This is a test..."); text_callback_list[0].closure = (XtPointer) &text_data1; XtSetArg(args[1], XtNcallback, text_callback_list); text1 = XtCreateManagedWidget("text1", asciiTextWidgetClass, paned, args, 2); Any idea why this is? It would seem much easier and much more "elegant" to use the usual XtAddCallback call... AdvThanks, -- Gil. -- -------------------------------------------------------------------- -- Gil Tene "Some days it just dosn't pay - -- devil%imp@uunet.uu.net to go to sleep in the morning." - -- devil@diablery.10A.com - --------------------------------------------------------------------