Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!hacgate!goddard@aic.hrl.hac.com From: goddard@aic.hrl.hac.com Newsgroups: comp.windows.x Subject: Setting the Selection in a TextWidget Message-ID: <5909@hacgate.UUCP> Date: 31 Oct 89 03:27:26 GMT Sender: news@hacgate.UUCP Reply-To: @aic.hrl.hac.com Organization: Hughes Aircraft Co., El Segundo, CA Lines: 27 References: Using Xaw: I am having trouble with selecting text in a newly created TextWidget of class asciiDiskWidgetClass. I do an XtTextReplace to put the text on the screen, then an XtTextSetSelection to select the text just put on the screen. The text appears, and is highlighted. Then if I move the cursor to a window of another client (any *other* client) and middle-mouse click (which defaults to "insert-selection(PRIMARY,CUT_BUFFER0)", I get the following error message: X Toolkit Error: AtomPtr was not initialized But if I select the same text with the mouse before insertion, everything is fine, and moreover the problem does not re-occur after future calls to XtTextSetSelection. Curiously, the problem does not occur when I click to insert in another window of the client that has the selected text. After poking around in the code, I think the problem is that some Atom relating to one of the buffers, either primary or cut, is not created until the first *manual* selection. My client does an XtTextSetSelection before any manual selection. Can anyone give me an idea as to what I can do about this? Nigel Goddard