Harry Potter's magic button - a solution to another tricky group bug

Richard Gaskin ambassador at fourthworld.com
Mon Aug 9 23:34:42 EDT 2010

Wilhelm Sanke wrote:

> On August 7 you wrote:
>> Yeah, the boundingRect property been a godsend on some projects, and I
>> was quite pleased when Raney added it.  Makes short work of things that
>> can get quite complicated without it.
> Could you possibly provide us - the revolution users - with more details
> and examples, why the boundingrect is a "godsend" and and how it
> simplifies things that otherwise remain complicated?-

Looks like you did a good job of it here:

> Of course, the "boundingrect" is one of the solutions to the "set the
> loc of objects in a group" problem, identical (in that) to the effect of
> the "magic button", and very similar to the effect of Jacqueline's
> proposal to switch off the scrollbars of a group if the image is smaller
> than the group. The only difference when focusing on this bug - as it
> were "on the surface", but not only - is that with the "boundingsrect"
> scrollbars are tolerated with smaller images whereas with Jacqueline's
> proposal you have to turn the scrollbars off.

I think you've hit on the most complex aspects of it.  My own work must 
be pretty simple since that sort of complexity is stuff I never come across.

In my simple view, groups are dynamic, in the sense that they 
automatically adjust to fit the controls within them.  On this, one 
man's "dynamic" may be another man's "squirrelly", depending on various 
combinations of what you're trying to do, how much time you have to poke 
around trying, and how much coffee you had when you started out.

For me, the boundingRect makes things ultra-simple when what I want is a 
sort of canvas, a scrollable area of a fixed size which may represent a 
page or other construct of fixed size.

For other uses the default "squirrelly" mode is actually kinda great to 
me, as I can adjust the controls in my layout and the group resizes 
along with 'em.

But for fixed-size things like representations of a printed page, you 
can think of using the boundingRect as being like adding a rectangle 
graphic to the group to define the scroll region, except you don't need 
to add anything.

Hope that helps a bit, but if it doesn't that may explain why I don't 
write Rev's docs. :)

My advice on such things is usually to just play with properties in some 
new stack you don't care about to learn about them.  Reading can help 
you learn the syntax, but to really understand so many things nothing 
beats doing.  And exploring in a fresh stack means you can play freely 
without having to worry if you'll mess something up in a stack that 
actually matters.

  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