[comp.sys.next] terminal start-up

dz@casaba.ucsb.edu (Daniel James Zerkle) (08/11/89)

After a lot of diddling around, I managed to get the
"one-button-calculator" described in the documentation
running happily.  I also wrote my own simple application
using similar methods to what's in the ref man.

The only problem is that these apps think that they need
a Terminal window from which to run.  If I click on their
icons (default icons, not custom) from the browser, they
start up a Terminal before running.  I want these things to
run on their own, as they don't need stdio.

What's going on, and what can I do about it?

Another problem:

Lots of applications (Digital Librarian, Browser, WriteNow) use
other applications (Preview, WriteNow, Edit, ...) to display files
and the like.  How can one application let another one know that
it should be doing something (including starting up, if necessary)?
I assume that some sort of messaging is going on, or perhaps the
receiving end gets an event.  How do you know what sort of messages
to send to any particular application?

In case you're wondering, I'm going to put together an application
which uses the indexing facilities to sift through troff files
and can display the corresponding PostScript files (ptroff -t)
with Preview.  It would be nice to use Digital Librarian to do
the job, but it just doesn't have the capabilities.  (Actually,
'twould be nice to just extend DL so it will search one file and display
another...perhaps in 1.0)

If anybody has any ideas about any of these things, or, better yet,
is working on something similar, I would like to start up a correspondence
(send mail).

| Dan Zerkle home:(805) 968-4683 morning:961-2434 afternoon:687-0110  |
| dz@cornu.ucsb.edu dz%cornu@ucsbuxa.bitnet ...ucbvax!hub!cornu!dz    |
| Snailmail: 6681 Berkshire Terrace #5, Isla Vista, CA  93117         |
| Disclaimer: If it's wrong or stupid, pretend I didn't do it.        |

ali@polya.Stanford.EDU (Ali T. Ozer) (08/11/89)

In article <2201@hub.UUCP> dz@cornu.ucsb.edu  (Daniel James Zerkle) writes:
>After a lot of diddling around, I managed to get the
>"one-button-calculator" described in the documentation
>running happily.  ...
>The only problem is that these apps think that they need
>a Terminal window from which to run.  If I click on their
>icons (default icons, not custom) from the browser, they
>start up a Terminal before running.

If an app doesn't have the necessary MachO segment to hold an icon
image, then the Workspace manager assumes the app is not window-based
but shell-based. So it goes ahead and displays the generic icon and
runs it in a shell when you double-click on it.

Solution is to give your program an icon; it's as easy as entering the name 
of the icon file in the Project window of IB. If you don't feel creative
enough to make up an icon at the moment, you can just borrow one from the
examples directory and use that. 

Ali Ozer, NeXT Developer Support
aozer@NeXT.com

bruceh@zygot.UUCP (Bruce Henderson) (08/11/89)

In article <2201@hub.UUCP>, dz@casaba.ucsb.edu (Daniel James Zerkle) writes:
> The only problem is that these apps think that they need
> a Terminal window from which to run.  If I click on their
> icons (default icons, not custom) from the browser, they
> start up a Terminal before running.  I want these things to
> run on their own, as they don't need stdio.
> 
> What's going on, and what can I do about it?

The problem lies with your application's lack of an Icon.
This question has been asked a lot on the net, because the fact that
such a thing is needed and how to provide it are rather poorly
documented. [It may be the ONLY shortcomming of those wonderful Docs!]
but what you do is this....

In the interface Builder, bring up the Project window [under File] and
you will see a text field labeled "Application Icon".  You need to give
it the name of a tiff file that will represent the Application to the
workspace manager.  You can create your own by using the "Icon" program
found in /NextDeveloper/Demos/Icon.

When you use Icon, you want to use the Prefrences menu command an set
the window to your Icon's size.  This can be anything less that 64x64.
I have noticed that most applications use 48x48 or 56x56.  The Detail
window in Icon makes this job a whole lot easier. [BTW, I think Icon is
a pretty cool item...]  You want to save your tiff file with Alpha [in
the Save panel].  

Once you rebuild your app [after you set the Application Icon field in
the Project panel in IB], you will notice it has the default
Application Icon that looks like a MegaPixel Display, to get your icon,
you need to copy your program to somewhere your workspace manager knows
to look for applications.  I created /LocalApps, which is already in
the WorkspaceManager search path, and the copied it there.  once you do
that, you use the Browser Utilities menu to chose the find tools
command.  Things will wirr and spinf for a few seconds, and when it
stops, clicking on your application's name in the browser will bring
your icon up in the window.

> Lots of applications (Digital Librarian, Browser, WriteNow) use
> other applications (Preview, WriteNow, Edit, ...) to display files
> and the like.  How can one application let another one know that
> it should be doing something (including starting up, if necessary)?
> I assume that some sort of messaging is going on, or perhaps the
> receiving end gets an event.  How do you know what sort of messages
> to send to any particular application?

This is implemented through NeXT's two custom classes for IPC. they are
called Speaker and Listener.  They are both well documented in the 3
volume Technical Documentation and they are very useful in the
functionallity they implement.  If you need more you can always
subclass [isn't OOP great!]                


-- 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bruce Henderson                                       Software Engineer
zygot!bruceh@Apple.COM			    
"Sorry, Mathematica can't goon this much"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^