Locking size and position

Richard Gaskin ambassador at fourthworld.com
Fri Jan 8 10:42:10 EST 2010


DunbarX wrote:
> I was surprised to learn that a control that has its position locked in the
> inspector can't be moved in edit mode, but can be moved under script
> control. Should I have been so surprised?
>
> In other words, is there a way to really, really lock such a property of an
> object?

Sure:  set the lockLoc of the object to true and don't write any scripts 
that move it. :)

But seriously, can you tell us a bit more about the circumstances in 
your app you need to account for?

The lockLoc property prevents interactively adjusting the object with 
the mouse, but leaves your scripts free to control its size and position.

While the IDE provides tools which can affect an object's size, in that 
development mode you're likely to be doing layout tasks anyway so that 
doesn't seem so bad.

At runtime, unless you provide an extensible architecture in which other 
scripters can add stuff to your environment you should have complete 
control over what can and can't happen with those objects, so for 
deployment the lockLoc property would seem reasonably useful.

What circumstances are you encountering in which the lockLoc property 
and your scripts aren't providing what you need for the end-user experience?

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the use-livecode mailing list