Sharing and synchronziing backgrounds among substacks

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
montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Sharing and synchronziing backgrounds among substacks

Post by montymay » Fri May 22, 2020 12:22 am

Hello

As I understand background groups, a particular background group can be placed on any card within a stack with the "place" command or through the "object > place group" menu command. Changes in the group will be automatically reflected in every instance. But what if your application has many substacks where you want a particular background group to be shared among the substacks? Can a background group in one substack be shared with the sister substacks such that modifying the background on the one substack will automatically modify or "synchronize" the backgrounds placed in the other substacks? If that is not possible, is there a best method for synchronizing changes to a background in one substack and the backgrounds that have been pasted into the other substacks? All that I can think of is (1) copying the modified background, (2) deleting the old background group in the sister substacks, and (3) pasting the new background group into the sister substacks?

Thanks for any replies

Monty

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9655
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Sharing and synchronziing backgrounds among substacks

Post by dunbarx » Fri May 22, 2020 1:51 am

Hi.

BackGround groups only live in a single stack, whether main or sub

Do changes in the substack groups never take place on their own, they are just mirrors? In other words the subStacks groups have no functionality of any kind, at least anything that changes them in any way? You already have proposed reloading the main stack group to the appropriate cards on the subStacks. That will work.

So, just mirrors, then?

Craig

montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Re: Sharing and synchronziing backgrounds among substacks

Post by montymay » Fri May 22, 2020 2:25 am

Hi Craig

Thank you for your reply. Yes, the groups are basically just mirrors or empty vessels, a browser widget being the focus of the group. The only difference among substacks will be changes in the loaded PDF file and its associated properties (number of pages) when the user makes a selection from a list. As I continue to develop the application, I may want to add or change features of the group and will want to make the changes in every mirror so that the user has the same interface. You use the term "reloading" the main group to the appropriate cards in the various substacks. Is "reloading" something different from copying the modified group, deleting the superseded groups from the other substacks, and pasting the new group into them? I have many substacks containing the group, and It seems to be a cumbersome task, so I want to be sure that it is the best or only method.

Monty

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Sharing and synchronziing backgrounds among substacks

Post by FourthWorld » Fri May 22, 2020 4:10 am

One solution might be to go ahead and copy the group where you need it, but don't put code in the group. Instead, assign a behavior script to the group before you clone it. Then all copies will use one script. That won't do much for you if you need to add objects to the group (though there are ways to automate that; we can cover that if you get to the point), but will keep the code centralized to a single place.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”