Path: utzoo!attcan!uunet!cs.utexas.edu!usc!ucsd!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.hypercard Subject: Re: Creating a stack via Hypertalk? Message-ID: <10889@hoptoad.uucp> Date: 21 Mar 90 22:58:30 GMT References: <53654@microsoft.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 57 In article <53654@microsoft.UUCP> peterbak@microsoft.UUCP (Peter BAKO) writes: >I'm putting a stack together which needs to have a function that will >create a new stack with the name that is already residing in a card >field. Furthermore this new stack must have the same identical >first four cards as the stack which created it. If there is any way >for a script to paste a name into the Save a copy... dialog, then I >could use that, and then delete any cards which have a card number >greater then four. Can anyone offer a better method? Not a clean one, but it can be done. Do a New Stack command, then copy each card you need across to it using "doMenu Copy Card" and "doMenu Paste Card", with push/pop card commands to handle most of the inter-stack movement. Delete the first card of the new stack when you're done. I ran into a similar problem, except my stacks needed to copy eighty cards. I basically just gave up. I make the changes that are needed, which are only on the stack's first card, then I issue a doMenu Save a Copy..., then I revert the first card to its original state. I'd like to both go to the newly created stack and save its name and folder in the master stack, but there's doesn't seem to be any way to do this without either writing a copy stack XCMD or patching file system traps to record the location. >Also is there any way that I can detect if a user has double clicked >on a button? If yes, how? Easy. Just store the time between the first mouseUp and the second mouseDown in a global. It goes something like this: on mouseUp global lastUp,lastClick put the ticks into lastUp put the mouseLoc into lastClick end mouseUp on mouseDown global lastUp,lastClick if lastUp is not empty and the ticks - lastUp < 20 and abs(item 1 of lastClick - item 1 of the mouseLoc) < 3 and abs(item 2 of lastClick - item 2 of the mouseLoc) < 3 then send "doubleClick" to me -- put action in an "on doubleClick" handler end if put empty into lastUp end mouseDown Of course, you'll have to put option-L's in the conditional to make it all look like it's on one line. I don't want to screw up anyone's terminal emulator by putting them here. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "He goes on about the wailing and gnashing of teeth. It comes in one verse after another, and it is quite manifest to the reader that there is a certain pleasure in contemplating the wailing and gnashing of teeth, or else it would not occur so often." -- Bertrand Russell, "Why I Am Not a Christian"