[comp.sys.sgi] stdin under Workspace

bstewart@bnlux0.bnl.gov (Bruce Stewart) (10/24/90)

I have just joined the world of 4D series, and have a problem with
my graphics application software. I use the texport as dialog area; all
works well when I run the application by typing the command to
Irix in a shell. But when I start the application from Workspace,
all attempts at scanf on stdin return EOF, without giving me a
chance to type anything in the textport. I have already noticed
that the console icon must be opened prior to starting the
application from Workspace. What else am I missing?

Any clues would be appreciated.

bstewart@bnlux0.bnl.gov

eva@socrates.esd.sgi.com (Eva Manolis) (10/26/90)

In article <2260@bnlux0.bnl.gov>, bstewart@bnlux0.bnl.gov (Bruce Stewart) writes:
|> I have just joined the world of 4D series, and have a problem with
|> my graphics application software. I use the texport as dialog area; all
|> works well when I run the application by typing the command to
|> Irix in a shell. But when I start the application from Workspace,
|> all attempts at scanf on stdin return EOF, without giving me a
|> chance to type anything in the textport. I have already noticed
|> that the console icon must be opened prior to starting the
|> application from Workspace. What else am I missing?
|> 
|> Any clues would be appreciated.
|> 
|> bstewart@bnlux0.bnl.gov

The console is used by the WorkSpace for stdout and stderr (in case there
are any diagnostic or error messages that applications print)
but it is not intended to provide a textual I/O for applications.

You should run your application by launching a wsh and running from within.
To do this, you can either write a specific FTR for you application
(and then you can define an icon as well so it is distinguishable on the
 WorkSpace ), OR
you can use our predefined types for applications that need a terminal.

The generic type you'll probabl want to use (or mimic in your own ftr) is in 	
	/usr/lib/filetype/system/sgicmds.ftr,
and is called 
	TYPE ttyExecutable.
If you look at the ftr, you will see the OPEN rule ( the rule executed when
you double click on the icon) is :
	CMD OPEN winterm -c $LEADER $REST
winterm is a shell script that will start up a WINdowed TERMinal emulator
(by default wsh, but xterm can be used by setting an environment variable)
and run your application from the terminal emulator.
$LEADER and $REST are environment variables that are set to the selected files
by the WorkSpace.
See "Programming the IRIS WorkSpace" for more details.

Have fun,

--- The Giraffe Person at SGI......
    eva@sgi.com

betsy@vesuvius.esd.sgi.com (Betsy Zeller) (10/26/90)

In article <2260@bnlux0.bnl.gov> bstewart@bnlux0.bnl.gov (Bruce Stewart) writes:
>I have just joined the world of 4D series, and have a problem with
>my graphics application software. I use the texport as dialog area; all
>works well when I run the application by typing the command to
>Irix in a shell. But when I start the application from Workspace,
>all attempts at scanf on stdin return EOF, without giving me a
>chance to type anything in the textport. I have already noticed
>that the console icon must be opened prior to starting the
>application from Workspace. What else am I missing?
>
>Any clues would be appreciated.
>
>bstewart@bnlux0.bnl.gov

To make your application run from workspace so that it will use scanf
effectively, you need to tag it. Try doing this

	tag 0x400 your_application_name

Your application will now appear on workspace as a little picture of 
a terminal window. When you double click it, a text window will open,
showing you any text or prompts, and into which you can enter your input.
When you are done, close that window.

Tagging is the mechanism workspace uses to identify what icon to display,
and what behaviour to supply for a given file. The ascii files from which
workspace gets its information are in /usr/lib/filetype/default, install,
local, and system.

Any application which puts up its own window to run in will run just
fine from workspace without being tagged.

Betsy Zeller