Page 1 of 1

Tab panel with different content

Posted: Wed Oct 14, 2020 6:11 pm
by SEAL29
I can't resolve to have the tab panel on one card and different content under each tab.
I follow this lesson http://lessons.livecode.com/m/4071/l/75 ... ab-buttons Using Tabs on a Single Card to Hide/Show Content
But i can't create different content within tab panel.

Re: Tab panel with different content

Posted: Wed Oct 14, 2020 6:35 pm
by Klaus
The example stack works fine!
Click on -> Spells
and then click the button at the bottom of the card: Tabs on a single card
That will open another stack whcih shows what you are looking for!

The trick is to GROUP all the "different contents" and give these groups the same name as the TABs in your tabbed button.
TABBED Buttons receive 2 parameters with the "menupick" message -> menupick NewClickedTab,PreviousTab
Then you just "show grp NewClickedTab" and "hide grp PreviousTab", see the substack "Tab_on_signle_card"!

Re: Tab panel with different content

Posted: Wed Oct 14, 2020 7:09 pm
by SEAL29
If I want the same fields on each tab with only different content like a template? Then everything has to be put on a separate card?

Re: Tab panel with different content

Posted: Wed Oct 14, 2020 7:14 pm
by Klaus
SEAL29 wrote:
Wed Oct 14, 2020 7:09 pm
If I want the same fields on each tab with only different content like a template? Then everything has to be put on a separate card?
Yes, that requires to have your controls on different cards!
Because fields can only use their "sharedtext" property on different cards, not on the same card!
That is why we need to specify the card, too:

Code: Select all

put the text of fld "the one with sharedtext" OF CD 1 into tText

Re: Tab panel with different content

Posted: Wed Oct 14, 2020 7:20 pm
by SEAL29
Thank you, i understand. One more question, the cards can be made scrollable with script or settings?

Re: Tab panel with different content

Posted: Wed Oct 14, 2020 7:34 pm
by Klaus
Stacks and card cannot be scrollable!
You could group all objects on your card(s) and show the group's scrollbars.