Creating New Cards When 'Behave Like a Background' is True

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
acolburn
Posts: 6
Joined: Fri Jul 12, 2013 9:26 pm

Creating New Cards When 'Behave Like a Background' is True

Post by acolburn » Fri Jul 12, 2013 9:49 pm

My main stack has a tab panel which fills the window. The stack has three cards, one for each tab. The tab group property "behave like a background" is checked, and clicking each tab displays a different card. The whole thing is almost the same as the LiveCode lesson on using tab buttons (I would post the link but I lack permission to do so). ... It's your basic tabbed interface.

What I'd like to do now, though, is have a button click display a *different* card--that doesn't "behave like a background," i.e., no tabs, and positioned at a different place on the screen than the rest of the cards.

Is this possible in LC? If so, any hints?

Thanks! -- Al C.

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: Creating New Cards When 'Behave Like a Background' is Tr

Post by wsamples » Fri Jul 12, 2013 10:06 pm

To remove a group from a specific card see "remove" in the dictionary. (use the message box to issue the command to remove). It sounds like what you may want to do is create a new stack which opens when you click this button. See "go" in the dictionary.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Creating New Cards When 'Behave Like a Background' is Tr

Post by Simon » Fri Jul 12, 2013 10:34 pm

Also:
Create the new card
Select the group (that is behaving like a background)
From the menu select Object >Remove group.
done

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

acolburn
Posts: 6
Joined: Fri Jul 12, 2013 9:26 pm

Re: Creating New Cards When 'Behave Like a Background' is Tr

Post by acolburn » Fri Jul 12, 2013 10:38 pm

My thanks to you both for your replies! Quite helpful. I read the documentation; my question is answered. ... Looking around on my own some more I also came to see part of the issue for me is/was confusion between the concept of a card and that of a stack. I think, ultimately, I was talking about creating a new stack in this case.

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

Re: Creating New Cards When 'Behave Like a Background' is Tr

Post by Klaus » Fri Jul 12, 2013 10:43 pm

Hi acolburn,
acolburn wrote:My thanks to you both for your replies! Quite helpful; they answer the question. ... I am still a little confused here about the difference (and the advantages/disadvantages) between creating a new card vs. creating a new sub-stack of my main stack?
Example: You can only display ONE card of a stack at a time, but you can have many substacks and the mainstack open at the same time. :-)

Best

Klaus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Creating New Cards When 'Behave Like a Background' is Tr

Post by Simon » Fri Jul 12, 2013 10:49 pm

Hi acolburn,
Substacks are good containers for large snippets of code or functions that you intend to use in different applications, it is easy to copy the substack to a new main stack e.g.:
I have a substack that queries the shell for information on serial numbers of USB devices plugged in. Easy to add that to a new app. Could it all be incorporated into the card script? Yes.

As a beginner you probably will just deal (ha) with cards :)

I'm sure there are plenty of other good reasons to use a substack but I haven't used them for anything else (I think).

Simon
EDIT: OH I see... And what Klaus says! :)
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply