🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #173

Re: Info on Services

#173
From: Eric P. Scott
Date: Wed, 22 Jul 1992 07:30
49 lines
2373 bytes
In article <1992Jul20.234028.931@agora.uucp> bobb@agora.rain.com
	(Bob Beauchemin) writes:
>  I'd like to do something similar to what Interface Builder does when you
>invoke the "make" function. It appears that Interface Builder sends a
>message to Workspace Manager to launch a program (shell) and sends a series
>of commands to it to accomplish the make. I've looked at the subprocess
>example, but its not usable for the purpose I'm looking for.
>
>  Does anyone know how IB does this? There is an entry in the Services
>menu for "Open in Workspace" and I'm guessing that's how it may be
>accomplished.

Not even close.  I've posted this a few times in the past:

#import <appkit/Application.h>
#import <appkit/Listener.h>
#import <appkit/Speaker.h>
#import <appkit/publicWraps.h>

// Simulate typing the supplied string at a Workspace Shell Tool,
// creating a new Shell if necessary.  Unlike the UNIX system()
// function, you need to add the trailing \n explicitly.
int doUnixCommand(const char *command)
{
    int s;
    id spkr;
    static int toolPid;

    spkr=[NXApp appSpeaker];
    [spkr setSendPort:NXPortFromName(NX_WORKSPACEREQUEST, (const char *)NULL)];
    // If we simply used the doUnixCommand: method, it would always
    // launch a new Shell each time.
    if ((s=[spkr selectorRPC:"doUnixCommand:oldTerminal:newTerminal:"
	paramTypes:"ciI", command, toolPid, &toolPid])!=0) NXBeep();
    return s;
}

I assume that since this is undocumented, it doesn't work in 3.0,
but since I'm probably the only regular poster to this newsgroup
who doesn't have 3.0PR2, I just can't tell you.

>  Is there documentation of the standard services provided by the NextApps
>(like Workspace Manager) and how to access them?

There's documentation on the _standard_ services, but this isn't
a standard service.  I've heard that NeXT is going to
significantly deemphasize Speaker/Listener usage in 3.0.

					-=EPS=-
Technical Details
Message-ID: <1992Jul22.073053.26256@csus.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!decwrl!csus.edu!news
References: <1992Jul20.234028.931@agora.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!decwrl!csus.edu!news
From: eps@futon.SFSU.EDU (Eric P. Scott)
Subject: Re: Info on Services
Message-ID: <1992Jul22.073053.26256@csus.edu>
Sender: news@csus.edu
Reply-To: eps@cs.sfsu.edu
Organization: San Francisco State University
References: <1992Jul20.234028.931@agora.uucp>
Date: Wed, 22 Jul 1992 07:30:53 GMT
Lines: 49