[comp.sys.amiga] How to get ShowANIM to start AND STOP from an icon

jms@antares.UUCP (joe smith) (12/03/88)

In article <1119@esunix.UUCP> blgardne@esunix.UUCP (Blaine Gardner) writes:
>I hope I didn't start any flames with my first posting, but I was trying
>to figure out why Walker was crashing. I still have no idea why (maybe
>it was already discussed), but I found out how to stop it. If I have
>IconX execute a script that makes the 3 assigns, and runs the demo,
>nasty things happen, including writes to the hard drive that corrupted
>one or more of the data files.
>
>On the other hand, if I have the following IconX script, everything is
>fine.
>
>newcli from walker.exec
>
>Walker.exec is the same script that IconX was executing directly before.

Thank you thank you thank you.

You have helped me solve the problem I was having with ShowANIM.  I rushed
right home and put the suggestion to work.  It appears that certain things,
such as recognizing Control-C or doing an ASSIGN requires a process with a CLI
structure, something that XICON lacks.  In particular, if you run any of the
BADGE killer demos from last year by clicking on the icon, XICON starts
ShowANIM, but you can't abort it by typing Control-C.  Left-Amiga-N does not
work; the only way out had been to reboot the machine.  But no more!

Here's how I did it.  The project icon (RunDemo.info) has :c/XICON as its
default tool.  The RunDemo file has 3 lines:
	cd DemoDisk:DemoDirectory
	type ReadMeLast
	NewCLI CON:0/0/640/200/ShowANIM from Credits
The Credits file is:
	;This demo was created by Joe Smith
	; ... distributable ...
	; name, address, etc
	:c/ShowANIM -l +4 DemoFile
	:c/less ReadMe
	EndCLI

When the RunDemo icon is clicked, the one-page file ReadMeLast is put up on
the screen and then almost immediately covered up by the NewCLI window.
ShowANIM runs until the user types Control-C.  Then the ReadMe file is
presented, one screen at a time.  At the end of this file, the NewCLI
window goes away, and leaves the XICON window which is still displaying
the ReadMeLast file.  The user clicks XICON's close gadget to terminate
the demo.

>Two questions:
>1) Was this problem cause by IconX, The Director, or the phase of the
>   moon?
>
>2) Sometimes when the Walker demo is exited (by clicking a mouse button)
>   the sound channels are not given back to the system. Any fix for
>   this?
>
>	Thanks, Blaine.

I expect we would not have as many problems if XICON ran as a process with
CLI instead of as a process without CLI.  (I haven't tried ICONX from 1.3
to see if it has the same problems.)

-- 
+----------------------------------------------------------------------------+
| TYMNET:JMS@F29  CA:"POPJ P,"  UUCP:{ames|pyramid}oliveb!tymix!antares!jms  |
| INTERNET: (Office-1.ARPA is no more)      PHONE:Joe Smith @ (408)922-6220  |
+----------------------------------------------------------------------------+

blgardne@esunix.UUCP (Blaine Gardner) (12/06/88)

From article <286@antares.UUCP>, by jms@antares.UUCP (joe smith):
< In article <1119@esunix.UUCP> blgardne@esunix.UUCP (Blaine Gardner) writes:
<>newcli from walker.exec
<>
<>Walker.exec is the same script that IconX was executing directly before.
< 
< Thank you thank you thank you.
<
< You have helped me solve the problem I was having with ShowANIM.  I rushed
< right home and put the suggestion to work.  It appears that certain things,
< such as recognizing Control-C or doing an ASSIGN requires a process with a CLI
< structure, something that XICON lacks.  In particular, if you run any of the
< BADGE killer demos from last year by clicking on the icon, XICON starts
< ShowANIM, but you can't abort it by typing Control-C.  Left-Amiga-N does not
< work; the only way out had been to reboot the machine.  But no more!

Hey, I hadn't thought about that! I too was hitting the same problem
with the ShowANIMs refusing to exit, but hadn't thought of using this to
cure that problem. I'll try it out tonight.

Thanks yourself!
 
< Here's how I did it.  The project icon (RunDemo.info) has :c/XICON as its
< default tool.  The RunDemo file has 3 lines:
< 	cd DemoDisk:DemoDirectory
< 	type ReadMeLast
< 	NewCLI CON:0/0/640/200/ShowANIM from Credits

I'd suggest switching to IconX because it does a cd to the icon's
directory, and saves you the hassle of cd'ing to the demo's directory.
Also with IconX you can

Assign NeatDemoDisk: ""

to make any necessary volume name assigns. The advantage of doing it
this way is that you don't have to rewrite your IconX script if you copy
it to someone else's hard drive (or another directory on your own
drive).

< The Credits file is:
< 	;This demo was created by Joe Smith
< 	; ... distributable ...
< 	; name, address, etc
< 	:c/ShowANIM -l +4 DemoFile
< 	:c/less ReadMe
< 	EndCLI
< 
< When the RunDemo icon is clicked, the one-page file ReadMeLast is put up on
< the screen and then almost immediately covered up by the NewCLI window.
< ShowANIM runs until the user types Control-C.  Then the ReadMe file is
< presented, one screen at a time.  At the end of this file, the NewCLI
< window goes away, and leaves the XICON window which is still displaying
< the ReadMeLast file.  The user clicks XICON's close gadget to terminate
< the demo.

If you'd rather not mess with the "ReadMeLast" and having to click on a
kill gadget, using IconX and setting the Tooltype "WINDOW=NIL:" in
your script's icon will keep IconX from opening it's own window. (Thanks
to Paul Higgenbottom and Andy Finkel for this tip.)

Now does anyone have any ideas on how to do an EndCLI from the IconX
script on the Walker demo? This (all?) Director demo exits when a mouse
button is clicked, but the Projector program seems to spawn off it's own
CLI process. The EndCLI gets executed as soon as the Projector program
runs the script, and when I exit the demo, I've got a dead CLI window
that can't be closed. 


PS  All this work in putting demos on my hard drive was prompted by the
local University computer fair. There were factory reps there from
Apple, SGI, NeXT, etc. But our Amiga display was a strictly amateur
effort by our user's group. It was a great success, NeXT and the Amiga
were the crowd drawers, and even the NeXT rep was impressed with Deluxe
Music. What the Amiga lacks in sound quality we made up with a pair of
Klipsch LaScalia speakers (the NeXT only had the tinny speakers in it's
monitor).

The stars of our show were the Walker Demo, NewTek's DemoReel 1 (anyone
seen number 2 yet?), Probe Sequence, and the time we accidentally
started up Firepower with the audio amp turned all the way up.  :-)

A question for Paul Higgenbottom: does Commodore provide any kind of
official support for shows like this? I think we did ok for amateurs,
but if we can get some help from Commodore next year, it would be great.

-- 
Blaine Gardner @ Evans & Sutherland    580 Arapeen Drive, SLC, Utah 84108
Here: utah-cs!esunix!blgardne   {ucbvax,allegra,decvax}!decwrl Pesunix!blgardne
There: uunet!iconsys!caeco!pedro!worsel!blaine (under construction)
"Nobody will ever need more than 64K."    "Nobody needs multitasking on a PC.