Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!hsdndev!think.com!zaphod.mps.ohio-state.edu!mips!wdl1.wdl.loral.com!wdl50!mdm From: mdm@wdl50.wdl.loral.com (Mike D Marchionna) Newsgroups: comp.sys.next Subject: XtAddInput analog in NeXT Step Summary: Is an analog to XtAddInput available in NeXT Step Keywords: X windows, NeXT Step, programming Message-ID: <1991Mar1.174526.17075@wdl1.wdl.loral.com> Date: 1 Mar 91 17:45:26 GMT Sender: news@wdl1.wdl.loral.com Organization: LORAL Western Development Labs Lines: 24 Hey gang. Here is something unusual for this group, a programming question. :-) I have recently been toying with the idea of porting some X window code to NeXT step. Most of the code would seem to have similar or equivalent functionality to certain NeXT Step objects except for one aspect. In X there is a function called XtAddInput that allows the caller to specify a UNIX file descriptor to monitor. XtAddInput will invoke a specified callback routine whenever there is data to read on the indicated file descriptor. Basically XtAddInput generates a pseudo window event that your program can choose to respond as you see fit. I don't know if any such functionality exists under Next Step. In NeXT Stepese I guess what I what I would need is a function that could be called without blocking, and would send a specified message to a specified object whenever the indicated file descriptor has information to read. One approach I had in mind was to start a Mach thread that performed a blocking read and then sent an Objective C message to NXApp or some such object that read and processed the data and then restarted the the thread for the next read. Is there any way to implement such a function, or is one already available. Many thanks for any information this group is kind enough to provide. -- +--------------||--##--%%--@@------+--------------------------------------+ |El-Rayo-X-----||--##--%%--@@----->| Brain and brain! What is brain! | |El-Rayo-X-----||--##--%%--@@----->| --Star Trek (Spock's Brain) | +--------------||--##--%%--@@------+--------------------------------------+