Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!bacchus!matt From: matt@bacchus.esa.oz (Matt Atterbury) Newsgroups: comp.windows.x Subject: ProcessContext in X11R4 Xt library (bug?). Message-ID: Date: 9 May 91 04:10:22 GMT Sender: matt@bacchus.esa.oz.au Distribution: comp Organization: Expert Solutions Australia. Lines: 47 [Sorry if this has been fixed in a fix we don't have]. All the manuals I have [O'Reilly and X] say that you should use XtAppInitialize rather than XtInitialize, so I did. But there is one thing that XtInitialize does that XtAppInitialize doesn't do, and that is to set up the [single, static] process context's defaultAppContext field [this is used extensivley in the Xt library]. The symptom was that a home-grown widget's translation table was being 'handled' OK but the action table for it was being ignored - result: 'Warning: Actions not found:' error messages. 1st Question) is this a problem in XtAppInitialize or in the widget? The before code I had was: XtToolkitInitialize(); *** app_context = XtCreateApplicationContext(); display = XtOpenDisplay(app_context, ...); toplevel = XtAppCreateShell(NULL, ...); The after code is: extern XtAppContext _XtDefaultAppContext(); XtToolkitInitialize(); *** app_context = _XtDefaultAppContext(); display = XtOpenDisplay(app_context, ...); toplevel = XtAppCreateShell(NULL, ...); _XtDefaultAppContext() will create an app context if there isn't a default already, and returns the default app context. The actions problem has gone away. Note that I cannot use XtInitialize since I am opening a number of displays. 2nd Question) assuming the widget is OK, what is the ideologically correct way of getting the default app context set up properly [_XtDefaultAppContext is supposedly an internal Xt routine - it may go away?]? Any information/responses welcome. cheers ... -- ------------------------------------------------------------------------------- Matt Atterbury [matt@bacchus.esa.oz.au] Expert Solutions Australia, Melbourne UUCP: ...!uunet!munnari!matt@bacchus.esa.oz.au "klaatu barada nikto" or: ...!uunet!murtoa!bacchus.esa.oz.au!matt "consider this a divorce" ARPA: matt%bacchus.esa.oz.AU@uunet.UU.NET "life? don't talk to me about life!"