URGENT-How to add "New Card" button/menu to stack

Marian Petrides mpetrides at earthlink.net
Wed Jun 23 15:34:03 EDT 2004


Ah, good point, Jim. I had momentarily forgotten the inability to save 
to standalone when I suggested using doMenu.

Okay, Dan. Try this:

1)   Modify your address book stack as mentioned in my previous 
email--incorporating doMenu-- and save it.  Say it is named 
AddressBook.rev

You will also have to create some way to SAVE the stack once modified.  
Simplest way to do this is to create a prompt as whenever you try to 
quit  (by clicking the close box):

Add a line to the stack script which says

on shutdownRequest
      Answer "Save stack first" with "No" or "Yes"
      --creates a dialog with yes as default answer
     If it is "Yes" then
           save this stack
    Else
        close this stack
    End if
end  shutdownRequest

You may have to put a similar handler in other locations if you have 
alternative ways to quit from the stack (e.g. command-key equivalent).  
For commandKey equivalents, the handler would be on commandKeyDown (or 
on ControlKeyDown  --if you are on a PC.

Save this modified AddressBook stack.  Do not make it a standalone.


2) Create a very simple stack named SplashScreen  which has one card 
that simply says  "Loading AddressBook"

3)  Put the following into the Stack script of SplashScreen:

On OpenStack
     go to card 1 of stack "AddressBook.rev
     close stack "SplashScreen"
     --assuming you have no need for SplashScreen to stay open once 
AddressBook is launched
End OpenStack

(could also be done as an openCard handler in the card script instead)

4)  When done, build SplashScreen into a standalone.

Now, when you double-click on SplashScreen, it will briefly display the 
"Loading AddressBook" card,  then open AddressBook and quit itself.  
The button you created in step 1, when pressed, should execute the 
doMenu command and create a new card. Whenever you try to quit, the 
Answer dialog should get evoked, giving you an opportunity to save the 
stack with the new card(s).

I think this should do the trick.

Marian


On Jun 23, 2004, at 3:11 PM, Jim MacConnell wrote:

> Dan
>
>> I assist a professor at my university and have imported his old
>> HyperCard Address Book stack into Revolution.  I then saved it as a
>> standalone application.  I need to figure out how to add a "add new
>> card" button, like his old HyperCard stack had.
>
> Everyone else will probably chime in soon with numerous ways to clone 
> cards,
> create cards, etc.
>
> The thing that I still struggle to remember though (as a relative 
> newbie) is
> that you can't save changes to a standalone. So if you make a new card
> (however you like) then quit.. The card won't be there when you open 
> the
> standalone next time. The easiest answer is to make a little stack 
> (splash
> screen) that opens the address book stack for you (or your professor).
>
> So.. build a nice little stack that can even have a single field saying
> "Opening Address book for you...". In that stack have a script handler 
> that
> says "open stack "Address Book" or whatever you've called it. Then 
> when you
> close/quit the address book standalone, it will properly save changes 
> (after
> asking you of course?).. Or do you need to say Save stack(?).. Now I'm
> getting confused...
>
> Doesn't matter.... Again someone will chime in soon on the various 
> ways to
> do this also. I just wanted to let you know that you may be doing 
> everything
> fine  from a HyperCard perspective and yet not getting what you expect.
>
> Jim
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list