Path: utzoo!attcan!sobmips!uunet!snorkelwacker!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Xt Initialization Message-ID: <8911151300.AA27269@LYRE.MIT.EDU> Date: 15 Nov 89 13:00:01 GMT References: <1989Nov14.233038.21326@Solbourne.COM> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 29 > I have seen the > comment "The semantics of calling XtToolkitInitialize more than once > are undefined", and am wondering why this is. The comment exists to warn application developers that the effect of calling this routine more than once is dependent upon the particular implementation of Xt. Therefore, any application which relies on a particular behaviour is non-portable. > Is there a way to find out if the toolkit has already been initialized? Not directly, though there are several areas where a side-effect is readily observable. For example, if any composite widget has been created (including a top-level shell) then the resource list returned by XtGetResourceList(compositeWidgetClass) will contain the Core resources, otherwise it will only contain the Composite resources. > Another solution would be for my application to 'let the library know' > if it will be doing the toolkit initialization ... or provide a MyLibraryInitialize procedure which does the Xt initialization. If your library expects to share an application context with the application then you'll have to communicate this information anyway. If you library is creating a separate application context then to be portable you'll have to provide some way for the application to tell you whether or not to initialize Xt.