Newsgroups: comp.windows.x Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!zardoz.eng.ohio-state.edu!kcgl1.eng.ohio-state.edu!JONESD From: JONESD@kcgl1.eng.ohio-state.edu (David Jones) Subject: Re: VMS XtAddInput Message-ID: <1991Jun1.070736.24221@zardoz.eng.ohio-state.edu> Sender: news@zardoz.eng.ohio-state.edu (Usenet news) Nntp-Posting-Host: kcgl1.eng.ohio-state.edu Organization: The Ohio State University References: <166@thor.sdrc.com> Date: Sat, 1 Jun 1991 07:07:36 GMT In message <166@thor.sdrc.com>, mustard@thor.sdrc.com (Sandy Mustard) writes: >I'm having a problem with X on VMS that I'm hoping someone out there >might be able to help me with. > >Basically I have a process that is running as an X client. It spawns >using SYS$CREPRC a subprocess (right now I'm using LOGINOUT.EXE) and >assigns newly created mailboxes to it's stdin, stdout and stderr. I >issue a QIO with a IO$M_WRTATTN mode and have it invoke an AST. This >AST will set an event flag whenever some process writes into that mailbox. >The event flag is given as the source for the XtAddInput call. > >The problem is that the call back specified in the XtAddInput call never >gets invoked. I do see during the debugging trace that the event flag >does get set. > > The source code follows if this may help. > > [ source deleted ] You are using LIB$GET_EF to allocate an event flag number, which returns flag numbers in cluster 1 (32-63). The XtAddInput function requires that the flag be in cluster 0 (0-31). You'll have to manage the event flag allocation yourself, I believe the toolkit uses flags 24 and 25 and RMS uses something in the upper 20s, so you should stick with low flag numbers if possible. Also be aware that the client_proc is responsible for clearing the event flag. If it returns with the event flag still set, the dispatcher will call it again immediately. Your code will be more robust if you use the second argument to XtAddInput as well. The GL_CHILD structure should have a psuedo-iosb for use as the second argument to XtAddInput. When you clear the event flag, also zero the first word of the iosb. Likewise, when you set the event flag, deposit a 1 in the first word. The ast parameter for the write attention ast would have to be changed to the address of the structure. David L. Jones | Phone: (614) 292-6929 Ohio State Unviversity | Internet: 1971 Neil Ave. Rm. 406 | jonesd@kcgl1.eng.ohio-state.edu Columbus, OH 43210 | jones-d@eng.ohio-state.edu Disclaimer: A repudiation of a claim.