home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5169 < prev    next >
Encoding:
Text File  |  1992-07-21  |  2.3 KB  |  62 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!sun-barr!decwrl!csus.edu!news
  3. From: eps@futon.SFSU.EDU (Eric P. Scott)
  4. Subject: Re: Info on Services
  5. Message-ID: <1992Jul22.073053.26256@csus.edu>
  6. Sender: news@csus.edu
  7. Reply-To: eps@cs.sfsu.edu
  8. Organization: San Francisco State University
  9. References: <1992Jul20.234028.931@agora.uucp>
  10. Date: Wed, 22 Jul 1992 07:30:53 GMT
  11. Lines: 49
  12.  
  13. In article <1992Jul20.234028.931@agora.uucp> bobb@agora.rain.com
  14.     (Bob Beauchemin) writes:
  15. >  I'd like to do something similar to what Interface Builder does when you
  16. >invoke the "make" function. It appears that Interface Builder sends a
  17. >message to Workspace Manager to launch a program (shell) and sends a series
  18. >of commands to it to accomplish the make. I've looked at the subprocess
  19. >example, but its not usable for the purpose I'm looking for.
  20. >
  21. >  Does anyone know how IB does this? There is an entry in the Services
  22. >menu for "Open in Workspace" and I'm guessing that's how it may be
  23. >accomplished.
  24.  
  25. Not even close.  I've posted this a few times in the past:
  26.  
  27. #import <appkit/Application.h>
  28. #import <appkit/Listener.h>
  29. #import <appkit/Speaker.h>
  30. #import <appkit/publicWraps.h>
  31.  
  32. // Simulate typing the supplied string at a Workspace Shell Tool,
  33. // creating a new Shell if necessary.  Unlike the UNIX system()
  34. // function, you need to add the trailing \n explicitly.
  35. int doUnixCommand(const char *command)
  36. {
  37.     int s;
  38.     id spkr;
  39.     static int toolPid;
  40.  
  41.     spkr=[NXApp appSpeaker];
  42.     [spkr setSendPort:NXPortFromName(NX_WORKSPACEREQUEST, (const char *)NULL)];
  43.     // If we simply used the doUnixCommand: method, it would always
  44.     // launch a new Shell each time.
  45.     if ((s=[spkr selectorRPC:"doUnixCommand:oldTerminal:newTerminal:"
  46.     paramTypes:"ciI", command, toolPid, &toolPid])!=0) NXBeep();
  47.     return s;
  48. }
  49.  
  50. I assume that since this is undocumented, it doesn't work in 3.0,
  51. but since I'm probably the only regular poster to this newsgroup
  52. who doesn't have 3.0PR2, I just can't tell you.
  53.  
  54. >  Is there documentation of the standard services provided by the NextApps
  55. >(like Workspace Manager) and how to access them?
  56.  
  57. There's documentation on the _standard_ services, but this isn't
  58. a standard service.  I've heard that NeXT is going to
  59. significantly deemphasize Speaker/Listener usage in 3.0.
  60.  
  61.                     -=EPS=-
  62.