help on design

Charles Hartman charles.hartman at conncoll.edu
Wed Aug 17 20:04:01 EDT 2005


The tutorial app that I hope I'm finishing up includes a "reference"  
substack that the user is likely to keep onscreen beside the main  
stack. It would be useful to have "forward" and (especially) "back"  
buttons for navigation within that substack. Here's how I thought of  
doing it:

In the stack script, I'd put an openStack handler that initialized a  
couple of globals:
         put empty into gHistoryList
         put 0 into gHistoryPointer
I'd put an openCard handler in each card, I guess:
         put the name of this card after gHistoryList
         put return after gHistoryList
         add 1 to gHistoryPointer
and I'd copy a Back button onto the card with this mouseUp:
         if gHistoryPointer > 0 then
             subtract 1 from gHistoryPointer
             put line gHistoryPointer of gHistoryList into tDest
             go to tDest
         end if

Does this seem like the best approach? Or is there a better method --  
or something built into Rev -- that I'm missing?

Any suggestions on the trickier problem of the "Forward" button? The  
simple system I've outlined makes it seem easy (if gHistoryPointer is  
< the number of lines in gHistoryList then go to the card named on  
the next line in gHistoryList). But not at all clear what should  
happen when the user first clicks the Back button, and then navigates  
to some other card. I don't see an easy way to handle multiple-path  
Forwards. Somewhere, I have to delete lines from gHistoryList that  
are "below" the gHistoryPointer . . .

Confused & glad to get any advice,

Charles Hartman




More information about the use-livecode mailing list