[comp.sys.next] extra terminal launch

abe@mace.cc.purdue.edu (Vic Abell) (01/13/89)

When I double-click from the browser to launch an application I have built
with the Interface Builder (e. g., the Celsius to Fahrenheit calculator), it
is always accompanied by the automatic launch of an extra terminal process,
complete with window and menu, followed by the requested application's
displays.  Does anyone know why this happens?

When I execute the application from a terminal window with a csh execution
command, I don't get the extra terminal launch.

jfm@ruddles.sprl.umich.edu.engin.umich.edu (John F. Mansfield) (01/13/89)

In article <1478@mace.cc.purdue.edu> abe@mace.cc.purdue.edu (Vic Abell) writes:

(actually he was complaining about and extra terminal turning up when
he ran his program)  What I am curious about was how to create a
second terminal window from the "desktop", clicking on the shell icon
only seems to create one.  Am I being really stupid?


John Mansfield
North Campus Electron Microbeam Analysis Laboratory 2455 Hayward, Ann Arbor,
Michigan 48109-2143. 313-936-3352
Internet: jfm@ruddles.sprl.umich.edu or john_mansfield.um.cc.umich.edu

ali@polya.Stanford.EDU (Ali T. Ozer) (01/13/89)

In article <1478@mace.cc.purdue.edu> abe@mace.cc.purdue.edu (Vic Abell) writes:
>When I double-click from the browser to launch an application I have built
>with the Interface Builder (e. g., the Celsius to Fahrenheit calculator), it
>is always accompanied by the automatic launch of an extra terminal process,
>complete with window and menu, followed by the requested application's
>displays.  Does anyone know why this happens?

When the Workspace is launching an app, if it doesn't recognize the app
as a Mach executable, it assumes the app cannot be run directly. So
a Terminal is started and the app is run in the Terminal. (Or at least
that's what it seems like. Amiga users will recognize this as the
same kind of thing that happens when XIcon or IconX is used to 
automatically start a shell to run programs that cannot be directly
run from the Workbench.)

By default, the IB generated Makefile lacks the few lines of magic
that makes an executable into a Mach executable. Take a look at some of
the makefiles in /MyDisk/Programming/Examples/*. Some have LFLAGS
(or LDFLAGS; these are the command line options that get passed to the
linker) are set to something that looks like:

LFLAGS = -g -segcreate __ICON __tiff foo.tiff __ICON __header foo.header

(This is from memory; so please double check.)
The "-g" is debug; the rest of the flags specify the creation of a
Mach segment called "__ICON" which holds icon-image information for
this program. "foo.tiff" and "foo.header" are two files which contain
information about the icons; you can, if you wish, simply replace those 
two files by an zero-length file. This way you get a Mach segment,
preventing the Terminal window from appearing during launchtime.
(But you won't have a custom icon for your app.) You can automate
the creation of a such a zero-length file with a "touch" appropriately
placed in the Makefile; some examples do this, I believe.

This stuff isn't very well documented, even in the official Tech Docs
for 0.8, mainly because it's all going to be automated or somehow
made easier in the future. Workspace behaviour might also be changed for 
non-Mach executables.

Ali Ozer, NeXT Developer Support
aozer@NeXT.com

STORKEL@RICE.BITNET (Scott Storkel) (01/14/89)

I have noticed this too, and it's really annoying. Perhaps IB does this
automatically so that there is always a window open in which you can run
the GDB debugger? Have you tried checking the "Interface Data" box when
when you decompile and then remake everything? I don't know that this will
help anything, but maybe whatever code is launching the extra terminal window
will get left out if IB thinks you are going to build a "real" application.

Scott Storkel
Macintosh Software Development
Rice University

abe@mace.cc.purdue.edu (Vic Abell) (01/18/89)

In article <40d71795.a590@mag.engin.umich.edu> jfm@ruddles.sprl.umich.edu.UUCP (John F. Mansfield) writes:
>                    What I am curious about was how to create a
>second terminal window from the "desktop", clicking on the shell icon
>only seems to create one.  Am I being really stupid?

Start subsequent Terminal/Shell applications by double clicking the
appropriate icon (or name) in the browser window of the Workspace manager
(after locating it, of course).

Vic Abell