A new button can be created using the command
domenu "New Button"
The trick is gaining access to this button so that you can set the
name and location. The button is added to the "end of the list."
-- Create the button
domenu "New Button"
-- Figure out the button number
put the number of buttons into btnNumb
-- Make it look right
set the name of button btnNumb to "Bob"
set the rect of button btnNumb to 10,40,80,60
set the style of button btnNumb to "shadow"
-- Be sure to go back to browse tool after creating
-- all the buttons
choose browse tool
You might want to use "lock screen" and "unlock screen" around these
statements so that the user doesn't see the button until the
script has finished building it.
----------------------------------------------------------------------
John Miller (604) 433-1795
Symplex Systems AppleLink (rarely) CDA0461
Burnaby, British Columbia Fax: (604) 430-8516
Canada usenet: john_...@mindlink.uucp
----------------------------------------------------------------------
-----------ja...@edsr.eds.com or ....uunet!edsr!jamii------------------
"Everyday, once a day, give yourself a present. Don't plan it, don't wait for it
just let it happen. It could be a new shirt from the men's store, a cat nap in
your office chair, or two cups of hot black coffee." - Agent Dale Cooper, TP
An even simpler solution:
domenu "New Button"
set name of last btn to "Bob"
set rect of last btn to 10,40,80,60
set style of last btn to "shadow"
choose browse tool
Cheers,
Eric.
__________________________________________________________________
| Eric Kofoid; Dept. Biology, U. of Utah; SLC, UT 84112 |
| (801) 581-3592 |
| kof...@bioscience.utah.edu |
| |
| -- The University of Utah is blameless for anything I've said -- |
|__________________________________________________________________|
Jeff E Mandel MD MS
Asst. Professor of Anesthesiology
Tulane University School of Medicine
New Orleans, LA
The "save" command in HyperCard 2.0 does what you want. Examples:
save this stack as "Fred"
save stack "Template" as "The stack I'm going to work with"
Kevin Calhoun
HyperCard Team
Apple Computer, Inc.
When you use the "create stack" command, you can specify which background
you want the new stack to have. Some examples:
create stack "New Stack" with background 3
create stack "Magyar" with this background
create stack "Slogans" with background "Fahrvergnugen"
The stack will be created and then opened. If you want it to be opened
in a new window, add the phrase "in a new window" to the command.
create stack "Berenstein Bears" with background 1 in a new window
If you don't specify a background, "create stack" creates a new stack
with a blank background.
The create stack command is new in HyperCard 2.0. It doesn't exist in
HyperCard 1.x.
If you want to create a stack with several cards, each with a different
background from the same source stack, you can create the stack first
and then copy additional cards into it. Suppose a stack has four
backgrounds, and you want to create a new stack with four cards, one
for each of the backgrounds of the source stack. You could do it this
way:
push card
create stack "My New Stack" with this background
pop card
set lockMessages to true
repeat 3 times
go next background
doMenu "Copy Card"
push card
go last card of stack "My New Stack"
doMenu "Paste Card"
pop card
end repeat
Of course, when you copy cards over to the new stack, they will retain
all of their card objects as well as their background objects.
Unfortunately, there still isn't a good way to copy just a background
from one stack into another already existing stack.