Re: Create button script won't work - why?

2010-11-16 Thread Bob Sneidar
I wonder if maybe storing the loc of the group, centering it, creating the button, then restoring the loc of the group would do? Stupid LiveCode Tricks you know. Bob On Nov 15, 2010, at 7:28 PM, Bantymom wrote: After reading what Bob said about in vs on I tried the following (after

Re: Create button script won't work - why?

2010-11-16 Thread Monte Goulding
On 17/11/2010, at 3:41 AM, Bob Sneidar wrote: I wonder if maybe storing the loc of the group, centering it, creating the button, then restoring the loc of the group would do? Stupid LiveCode Tricks you know. Setting the loc of the templateButton is the easiest way to do it. Cheers

Re: Create button script won't work - why?

2010-11-15 Thread Klaus on-rev
Hi Bantymom, I had similar problems with copy and paste, and discovered there really seemed no way to do it without being on the card. I could copy from another card, but I had to be on the card I wanted to paste to. So I use lock screen to go there in secret. Now, I'm a very

Re: Create button script won't work - why?

2010-11-15 Thread Bob Sneidar
You cannot create a button in a card. The in keyword only works with a group. You have to actually go to the card you want to create a button on. To go to a card in a stack you don't want your user to see, simply open the stack invisible, then close it when you are done. You can always push

Re: Create button script won't work - why?

2010-11-15 Thread Monte Goulding
You will have to set the defaultStack etc to create the group just like you were doing for the button but once the group is created you can create as many buttons as you like in it without worrying about the defaultstack etc. Alternatively you could have a template group on another stack and

Re: Create button script won't work - why?

2010-11-15 Thread Bantymom
After reading what Bob said about in vs on I tried the following (after making a group on card Two): on mouseUp create button Herb in group Two on card Two end mouseUp It worked. I'm sure it doesn't help the original situation, but I had to try it out. It doesn't matter where the group is,

Create button script won't work - why?

2010-11-14 Thread Bill Vlahos
Make a new stack called Test and label the card One. Put a button on the card with the following script: on mouseUp create button Fred in card One of stack Test end mouseUp The compiler doesn't complain but when I click the button I get this error: button Button: execution error at line 2

Re: Create button script won't work - why?

2010-11-14 Thread Mike Bonner
I don't think you can direct where the button goes, the dictionary says: Summary: Creates a new object on the current card. I believe you can get around this by placing a group on your card. Perhaps with an invisible background, sized to window size. At this point you can: create button Fred

Re: Create button script won't work - why?

2010-11-14 Thread Richard Gaskin
Bill Vlahos wrote: Is there a way to directly create a button on a particular card in a particular stack without going to it and doing all this? I think you've discovered a lack of orthogonality in the syntax: you can do what you want with an existing control using the clone command, but

Re: Create button script won't work - why?

2010-11-14 Thread Monte Goulding
Is there a way to directly create a button on a particular card in a particular stack without going to it and doing all this? The stack I want to create the button into is data stack that never gets viewed directly. In this case it will be data in the custom property of that button. You

Re: Create button script won't work - why?

2010-11-14 Thread Bill Vlahos
Monte, Am I able to create a group on the new card? I don't see a syntax for that. Gee, it isn't looking like I'm going to be able to do what I want. Discouraging. Bill Vlahos On Nov 14, 2010, at 9:33 PM, Monte Goulding wrote: Is there a way to directly create a button on a particular card in

Re: Create button script won't work - why?

2010-11-14 Thread Bantymom
I had similar problems with copy and paste, and discovered there really seemed no way to do it without being on the card. I could copy from another card, but I had to be on the card I wanted to paste to. So I use lock screen to go there in secret. Now, I'm a very unsophisticated and simple