Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!iuvax!purdue!decwrl!labrea!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: extra terminal launch Message-ID: <6075@polya.Stanford.EDU> Date: 13 Jan 89 15:02:18 GMT References: <1478@mace.cc.purdue.edu> Reply-To: aozer@NeXT.com (Ali Ozer) Organization: . Lines: 41 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