Page 1 of 1

Resizing items in a group

Posted: Sun Jun 08, 2008 12:51 am
by danrg7
I want to update a certain rectangle graphic (knob) whenever the group resizes. So, in the group script, I wrote a reziseControl method that looks like this:

Code: Select all

on resizeControl
  put the rect of me into grploc
  put the width of me into grpwidth
  put the height of me into grpheight
  
  put (item 1 of grploc) + (grpwidth * .25) into pt1
  put (item 2 of grploc) + (grpheight * .15) into pt2
  put (item 3 of grploc) - (grpwidth * .25) into pt3
  put (item 4 of grploc) - (grpheight * .6) into pt4
  put pt1,pt2,pt3,pt4 into newloc
  set the rect of graphic "knob" to newloc
end resizeControl
The only problem is that the group tries to resize itself after the rectangle inside of it resizes. I tried resetting the group's rectangle back to grploc at the end, but the rectangle inside the group seems to have moved by then. How can I stop the group from changing size when the rectangle resizes?

Posted: Sun Jun 08, 2008 6:58 am
by Mark
danrg7, you need to set the lockLoc of the group to true.

Mark

Posted: Sun Jun 08, 2008 3:57 pm
by danrg7
Thanks! I figured it would be just one little property that I could not find.