🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by frisinv Sun, 30 Aug 1992 17:22
Calling Apps
#897
Author: frisinv
Date: Sun, 30 Aug 1992 17:22
5 lines
540 bytes
   For an app I'm working on I need to have ImageViewer called. How do I  
do this? How do I call any app?

-----
Vince
Re: Calling Apps
#917
Author: Don McGregor
Date: Mon, 31 Aug 1992 06:09
37 lines
1757 bytes
In article 16435@pellns.alleg.edu, frisinv@alleg.edu () writes:
>
>   For an app I'm working on I need to have ImageViewer called. How do I  
>do this? How do I call any app?
 
Drat.  I just did this a few weeks ago but I don't have the code handy.

Anyway, look in the documentation for the Speaker class, which
has a brief example on sending messages to another app.  Basically,
you send a message to the Workspace with the file name.  The 
Workspace then opens the appropriate application and loads the
file.  You want to message the workspace and NOT ImageViewer;
if the user has specified another default application to look at .tiff files, 
that one should be launched instead.  The Workspace manager will look 
up the appropriate app to be used for that file extension.

It goes something like

int fileOpened, returnCode;
id mySpeaker = [[Speaker alloc] init];
port_t thePort = NXPortFromName(NX_WORKSPACEREQUEST, NULL);

if(thePort != PORT_NULL)
  {
    [mySpeaker setSendPort:thePort];
    returnCode = [mySpeaker openFile:"/users/bogon/foo.tiff" ok:&fileOpened];
   
   ...
  }

(All code uncompiled and probably guaranteed to crash horribly).

All this Mach messaging stuff is so cool, and it's gonna get even cooler.

---
Don McGregor | "That which does not overflow my swap file 
drm@esl.com  | makes me stronger." 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads