App structure

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tamederBUS5jsG
Posts: 4
Joined: Wed Jul 11, 2012 4:42 pm

App structure

Post by tamederBUS5jsG » Fri Jul 20, 2012 8:19 pm

Hi
I have a question that is probably pretty simple, and I hope there is a simple answer. I'm envisioning a project with an open-branching structure, and I'd like to know how to best build it. I'm attaching the plan.

Are the red, green and blue branches substacks? Are they separate stacks that all get added to a stack file?
I've got a pretty good handle on objects, navigation and the scripts, I just don't see the big picture yet.
Thanks for any tips you can give me. Once I 'see' it I can streamline my learning.
Tamara
Attachments
structure.jpg

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: App structure

Post by mwieder » Fri Jul 20, 2012 8:28 pm

Tamara-

Welcome to the forum. One thing that should help your thinking about this is that you can't have substacks of substacks. One level deep only. I don't quite get what you have in mind, but it looks like you're trying to nest more levels than that. Substacks can talk to each other, if that helps.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: App structure

Post by townsend » Fri Jul 20, 2012 8:33 pm

It would probably be easier to make each of them a card inside one stack. Easier, in that referencing variables between cards does not require a stack reference. And when coding, I find it much easier to jump between cards, than keeping multiple stack windows open. Each card has it's own unique window for objects, And it's own openCard and closeCard messages (events). No matter how many cards you have, it's very easy to jump from one to another.

tamederBUS5jsG
Posts: 4
Joined: Wed Jul 11, 2012 4:42 pm

Re: App structure

Post by tamederBUS5jsG » Fri Jul 20, 2012 9:03 pm

Thanks for the feedback, but I don't think I've explained my needs correctly. I'll explain it a bit more, referencing my diagram. In my diagram those are all cards, and I can see that doing it in one mainstack is possible, with navigation buttons on each card. However, my background is with software called iShell, and I'm used to structuring things a certain way. For example, if this was an app on gemstones, the second yellow card might contain an alphabetical list. After choosing one from the list, say ruby, you go to the series of red cards. The first red card would be a photo, the second red card a list of properties, and the third card some other relevant info, etc. The vertical connections would allow for flipping through the photos, or properties, etc. So without going back to the alphabetical list, I could swipe up to view the 'emerald' photo (the green series), and again for the sapphire (blue series).
If these are all cards in one stack, the navigation gets a bit messy, doesn't it?
Tamara

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: App structure

Post by mwieder » Fri Jul 20, 2012 9:29 pm

That does make things clearer - thanks for the explanation.

You can do this a number of ways. The easiest to think about is maybe having a naming convention and marking cards of a certain class. So you could have all your photo cards named "Photo NNN", where NNN is a number or the name of the gemstone or whatever, and then when you move to a photo card you mark all the cards with "photo" in the name and you can "go to the next marked card" to see the next photo.

But what I would do when faced with this situation is create three groups on the card. The first group would contain the photo, the second would contain the properties, etc.
Then on preopencard hide the groups you don't want to see and show the one you do want to see. You can keep track of which mode you're in so that moving to the next card would show its photo if you're in photo mode, its properties if you're in properties mode, etc.

tamederBUS5jsG
Posts: 4
Joined: Wed Jul 11, 2012 4:42 pm

Re: App structure

Post by tamederBUS5jsG » Fri Jul 20, 2012 9:44 pm

Perfect, thank you. I can see how either of your methods would work.
I still have a lot of learning to do, but I find if I have the big picture explained then the details fall into place a bit better.
Cheers,
Tamara

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: App structure

Post by mwieder » Fri Jul 20, 2012 10:34 pm

Cool. Check back if you run into problems.

BTW - I usually use a tabbed button control for this sort of thing. In the button's script I stick a script like

Code: Select all

on menuPick pChosen
  hideAllGroups
  show group pChosen
  -- optionally do whatever setup needs to be done here
  switch pChosen
    case "photos"
      break
    case "props"
      break
    case "misc"
      break
    default
  end switch
end menuPick

on hideAllGroups
  hide group "photos"
  hide group "props"
  hide group "misc"
end hideAllGroups

tamederBUS5jsG
Posts: 4
Joined: Wed Jul 11, 2012 4:42 pm

Re: App structure

Post by tamederBUS5jsG » Fri Jul 20, 2012 10:39 pm

Great help! I'll probably use this script... but I'm a long way from implementing it. I can see this forum is going to be really handy over the next few weeks!
Tamara

Post Reply