Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!rutgers!orstcs!nyevax!johnsot From: johnsot@nyevax.CAS.ORST.EDU (Tim G. Johnson) Newsgroups: comp.sys.mac.hypercard Subject: Re: Copying a background (hacker's tip & request for feature) Message-ID: <445@nyevax.CAS.ORST.EDU> Date: 8 May 89 03:16:22 GMT References: <39528@bbn.COM> <30160@apple.Apple.COM> Reply-To: johnsot@mist.CS.ORST.EDU (Tim G. Johnson) Organization: Oregon State University, College of Computer Science Lines: 69 In article <30160@apple.Apple.COM> dan@Apple.COM (Dan Allen) writes: >In article <39528@bbn.COM> mesard@BBN.COM (Wayne Mesard) writes: >> >>A) When in Background mode, the {Cut,Copy} Card menu items should change >> to {Cut,Copy} Background. (And Paste Card becomes Paste Background.) >> >>B) The background of a card should be a set'able property of that card. >> Thus, >> set background of this card to "MyOtherBg" > >Thanks for the ideas and input. The one problem with copying and >pasting a background in the same stack is that by doing so there will be >two identical backgrounds. How do you know which is which? By ID would >be the only way. A script could duplicate a background (more or less) >with the following script: > > --- Script Deleted --- > >I just wrote this in a few moments and have briefly tested it. It >allows background fields and buttons to be copied, as well as the >background's script and picture. No card specific information is >copied. Perhaps other enhancements could be made, but this is another >example of how many, many things can be done with HyperTalk. Yes, it >would be nice if we had a copy and paste of a background, but it is very >rare that it is needed. For those that want to do it, the above script >does it! Dan, you are wrong about this being a very rare need. I have needed the ability to copy a background on several different occasions. But you are right, it is very simple to solve using hypertalk. All you need to do is to copy the card, change the name of the bg ever so slightly, paste the card, change the name of the original bg back to the original, and then modify your duplicate (much easier than brute force copying each cd and bg item across to a blank bg). More importantly, though, I've needed the ability to change the background that a certain card references, which is the second point that was originally mentioned. I am developing a stack that has 6 VERY similar backgrounds each having several cards. As the users find inadeqecies in my interface, I modify the most used group of card's background untill it meets the user's needs. Then I need to propogate those changes to the other 5 backgrounds. This can be tedious and error prone when I have to do it by hand (there have been times that I've had to add 24 invisible buttons over the top of two columns of a field). If I could make a copy of the fixed background and just make the minor modifications to the new background, and then set all the cards to use that new bg, then I wouldn't have to always spend time copying buttons and fields. As it is, I have a script that makes a generic copy of the bg that contains all the necessary changes. It makes a copy of that, makes the minor changes for each type of bg, and then makes new cards in that bg, one at a time, copying over any card specific text from the old cd of the old bg, then deletes all the old cards. As you can imagine, this adds quite a bit of mystery to anyone who might want to try to understand my scripts. So I would like to echo the request: >>B) The background of a card should be a set'able property of that card. >> Thus, >> set background of this card to "MyOtherBg" Thanks for listening. -- -Tim G. Johnson -johnsot@mist.CS.ORST.EDU