Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.hypercard Subject: Re: Hierarchical stack buttons Message-ID: <10265@hoptoad.uucp> Date: 16 Feb 90 00:02:36 GMT References: <529@opus.NMSU.EDU> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 48 In article <529@opus.NMSU.EDU> lrasmuss@nmsu.edu (Linda Rasmussen) writes: >Does anyone know of an easy way to create UP and NEXT buttons in a very large >hierarchical stack? It looks something like this: > > a a a > b b b b b b > c c c c c c c c c c c c c c c c c c > >There are at least a hundred "a" cards; what we need is for UP arrow >buttons to go up to the parent "b" if they are a "c", or up to the >parent "a" if they are a "b". We also need the NEXT arrows to go to >the next "a" if they are on an "a" card, the next "b" if they are on a >"b" card, etc. Obviously this can't be done with background arrows! >...But it is rather time consuming to have to script the up and >next arrows on EVERY card. There have been some other suggestions, but one limited the names of cards and the others assumed that you would always traverse the stack in hierarchical order, which could be violated by the "Back" and "Recent" commands and by use of the message box to give direct "go" commands". I think the easiest way is to have a hidden background field in the C cards (I'm assuming A, B, and C are different backgrounds -- they should be) containing the name or id of the parent card. Then you just have the next button equate to "go to background field Parent". You can set up up short-term scripts that make it easy to to set this field, by actually moving to a card rather than by typing, during the stack authoring process. As for the next buttons, they're trivial if A, B, and C are different backgrounds. "Go to next card of this background" accomplishes what you need. It's more difficult, but not enormously, if you want the C cards to "next" by parent rather than as one continuous circle; you just have to check the hidden field and keep going until you come back to one with the same parent as the current card. By the way, the parent field doesn't have to be hidden. Users might appreciate a visual indication of the parent of the current card. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "American women, especially some of those on the net, might profit by being less concerned with their careers and more concerned with getting a good, old fashioned roll in the hay." -- William J. Fallon, wjf@cbnews.att.com, on soc.women (also uses the alias Walter J. Ficklestein)