Defaults for groups

Richard Gaskin ambassador at fourthworld.com
Tue May 17 11:06:30 EDT 2016


Sannyasin Brahmanathaswami wrote:

 > OK… let's try this: margins are set to 4 Click and delete the integer
 > 4, change to 0
 >
 > Close inspector.. huh?  Transparent border is still there…. What?
 > Open inspector… sheesh…  The 4 is back … I thought I just deleted it?
 > Is this IDE broken? It's not saving my changes? (My trust level for
 > this usefulness of this new product drops by some level… as much as
 > 50% for the impatient)

What you describe there sounds like an IDE bug, unrelated to any default 
object values.

When you set a value in the Inspector it should set that property's 
value in the selected object.  It shouldn't automatically save the stack 
file, but the change should be evident.

That recipe doesn't produce the same result here.  When I change the 
margins property the value is immediately changed in the object.

But if you can reproduce the action of setting a value and having it not 
take effect please submit that recipe in a bug report.


On the larger issue of property settings in general, the way the engine 
is designed to handle this is to provide us with template objects that 
we can set once anywhere in our scripts and have those values used for 
any new objects of that type created.

Most objects in LC can be used for a wide range of needs, and as Paul 
noted here yesterday the engine defaults for the group object are set as 
they are for those using them as an encompassing border for controls.

But as Jacque noted, the simplest solution is to make either a plugin or 
a part of your project's init scripts which sets any template objects 
however you like.  Two lines of code written once and you never need to 
even think about them again.  Then you get what you want and anyone else 
can also have what they want even if you both want different things.

Cost to your team: a few seconds.
Cost to the engine team: zero.
Cost to the community to accommodate an engine change: zero.

However -

...that requires that the IDE leave the template objects alone, or at 
very least store their properties in an array before changing them and 
then restoring the template object properties from the array before the 
IDE script using them is done.

Yesterday I made a quick test in which I found the margins property for 
the templateGroup was being reset between uses.  Today, however, I can't 
reproduce that.

That is, not reliably.

Once in a while I can run my test and find the group margins reset, but 
I can't pin down the steps needed for that.

If anyone here knows a recipe for allowing the IDE to change template 
objects without restoring them please post it here, and I'll add it to 
my test and submit a bug report.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list