Tab/card help

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
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Tab/card help

Post by phaworth » Fri Jul 03, 2009 6:29 am

It;s clear Revolution is a very powerful tool but I'm having trouble with some really basic concepts which I hope someone can help m,e with before I go down the wrong path.

First of all, should I think of a stack as an application and each card as a screen within the application? I think that's a correct analogy but not sure.

Next, I created a new stack and a card but I can't for the life of me figure out how to give a name to the card. I typed a name into the basic properties of the card but the menu bar for the card continues to display "Untitled" each time I open the stack.

Next, a tab panel onto my card and positioned several objects onto tab 1 but how do I add objects to tab 2 and tab 3?

Thanks in advance for any help.

Pete

Klaus
Posts: 14189
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Fri Jul 03, 2009 8:54 am

Hi Pete,

please see this page and load and examine all the stacks there:
http://www.runrev.com/developers/tutori ... nferences/

Especially my stack about "Controls"!
ther you will find answers to this and a lot of other future questions :)


Best

Klaus

Klaus
Posts: 14189
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Tab/card help

Post by Klaus » Fri Jul 03, 2009 8:59 am

Hi Pete,

here some quick answers to your other questions.
phaworth wrote:First of all, should I think of a stack as an application and each card as a screen within the application? I think that's a correct analogy but not sure.
To be correct: A stack is ONE (of possibly more) window of an application.
phaworth wrote:Next, I created a new stack and a card but I can't for the life of me figure out how to give a name to the card. I typed a name into the basic properties of the card but the menu bar for the card continues to display "Untitled" each time I open the stack.
The "title" of a stack will alway display the stacks name "automatically".
if you need to dispaly the name of the current card you could put this into the script of the stack (yes of the stack!)
This way the script will be called everytime you go to a card and you do not need to put this handler into the script of every card!

Code: Select all

on opencard
  set the title of this stack to the short name of this card
end opencard 
Et voila, the cards name in the titlebar :)


Best

Klaus

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Fri Jul 03, 2009 5:55 pm

Thanks Klaus, I will go through the tutorials.

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Fri Jul 03, 2009 7:59 pm

Klaus, I've been through the Controls demo stack you recommended and it was very useful, thank you. Navigation around my tab panel now works perfectly and I'm beginning to see how to use scripts at various levels.

Before I get too much further, I'd like to make sure I have the correct structure for my application. I understand the concept of stacks and cards but just came across the term substack so now I'm wondering the circumstances in which substacks should be used.

Am I right in thinking that cards in a main stack always open in the same window whereas opening a substack from the main stack results in a new window being displayed?

This seems like a key concept for my application. It has a main menu and 3 or 4 separate functional areas, each of which should be capable of having it's own window open, so there could be 3 or 4 windows open at any one time.

Thanks,

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm

Post by Bernard » Wed Jul 08, 2009 12:34 pm

Pete, your understanding about the windowing relationship between stacks and substacks is basically correct.

Although it's also true to say that an application can consist of many stacks which do not necessarily have to be sub-stacks of one main stack.

For example, if in the IDE you enable the following menu:

View/Revolution UI Elements In Lists

then open the Application Browser (at the following menu: Tools/Application Browswer), you will be able to see all the stacks (including some with sub-stacks) that make up the Rev IDE. (To hide these again, just toggle the View/Revolution UI Elements... menu).

There is even more one can learn on the relationship between windows/stacks, and I hope that my additional information hasn't confused you.

Please ask if you'd like more information.

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Wed Jul 08, 2009 5:35 pm

Thanks, I'll take a look at that. I want to make sure I don't go charging down the wrong path with stacks structures and have to redo things later!

Post Reply