Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!bbn!uwmcsd1!ig!agate!violet.berkeley.edu!pete From: pete@violet.berkeley.edu ( Pete Goodeve ) Newsgroups: comp.sys.amiga Subject: Re: xicon,fish disks 119-128 Keywords: xicon, demos, solutions Message-ID: <6973@agate.BERKELEY.EDU> Date: 13 Feb 88 08:16:12 GMT Sender: usenet@agate.BERKELEY.EDU Reply-To: pete@violet.berkeley.edu () Organization: University of California, Berkeley Lines: 119 In an earlier message (31 Jan 88) Robin LaPasha (ruslan@ecsvax.UUCP) says: > Just tried running some of the new demos (from the Badge Killer > Demo contest) on Fish disks 123-127. They didn't exit with ^C > as hoped. > [.....] You're right. Sorry about that. > Have I missed a bug report on Xicon 2.0? Did I get a bad copy? Nope. And it's not really a bug [!] It's due to a quirk in AmigaDOS that I couldn't find any way around. This is mentioned in the Xicon manual, and a work-around is described there too. Fred apparently missed this -- as did the folks who put the BADGe Demo disks together. Not surprising, I guess: it's sort of buried in the "Caveats" section! So I'd better go into a little more detail now. There are a couple of other tricks as well that make a xicon-driven application more portable; this is a good time to mention them too. The ctrl-C problem is a result of the way you have to pass a command script to the Execute() call. The only way to avoid starting a new CLI for each line in the script is to pass the SCRIPT as the INPUT stream, which -- due to the way in which the possible options are set up -- totally blocks you from making the resulting CLI interactive! The window attached to the CLI is output only; as a result ALL input -- including ctrl-Cs and such -- is totally ignored. The fix, in any situation where you need keyboard input to a program invoked by the script, is to redirect standard input for that program from another, temporary, CON: window. For something like ShowANIM, which only has to see a ctrl-C, it doesn't really matter how small or where it is, as long as it remains the active one. For example, this is the original script (rundemo) for "car" off Fred Fish's disk #123: ----------- echo "To stop this demo type CTRL-C at any time and then click on the" echo "Xicon window close gadget. This may take about 60 seconds to load..." echo "" AmigaLibDisk123:Car/ShowANIM +3 -c AmigaLibDisk123:Car/Car.anim ----------- This is the simplest modification to fix the problem: ----------- echo "To stop this demo type CTRL-C at any time and then click on the" echo "Xicon window close gadget. This may take about 60 seconds to load..." echo "" AmigaLibDisk123:Car/ShowANIM NIL: ? [!!] ...Complicated looking, but fairly straightforward (he says...). The trailing question-mark makes CD "prompt" (to device NIL:) for its argument, then read it from the input stream -- which has been redirected from the file that Xicon created on instruction from the LOCDIR tooltype. (You can then delete that file.) From then on you are working IN the directory that contains the icon, and presumably all the associated files. The advantage of this approach is that you can move the "car" directory bodily -- without having to change the script or any other files in it -- to any other disk that contains Xicon (in the :c directory if the "Default Tool" is ":c/xicon" as it is in the original). These are the ToolTypes I use for the "Car" demo icon: --------- LOCDIR=RAM:__car_dir MODE=closewindow WINDOW=20/20/500/160/The Car is coming.... --------- and here's the script that it invokes: --------- echo "To stop this demo type CTRL-C." echo "This may take about 60 seconds to load..." echo "CAUTION -- don't touch the left mouse button" echo "or you may not be able to use ctrl-C to stop" echo "" cd NIL: ? ;switch to proper working directory delete RAM:__car_dir stack 16000 ;not sure this is necessary -- seemed a good idea showanim Email is fine if this has been gone over before. [I'd have sent you E-mail, if I could ever get our damn mailer to recognize a path...] -- Pete Goodeve --