Group resizing.

Brian Milby brian at milby7.com
Sun May 3 11:38:40 EDT 2020


Do you have the group size/position locked (lockLocation property)? If not, moving a control could change the rect.

Thanks,
Brian
On May 3, 2020, 10:28 AM -0400, Håkan Liljegren via use-livecode <use-livecode at lists.runrev.com>, wrote:
> You probably need to lock messages in the beginning of your resizeControl. Otherwise the group will adapt to your resizing of your controls. I usually begin with both lock messages and lock screen, but the last is more for optimization.
>
> Håkan
> On 3 May 2020, 16:22 +0200, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com>, wrote:
> > I realized after the discussion last week about resizing that I was
> > missing the benefits of "resizeControl" being sent to each group, so I
> > changed one of my resize handlers to make use of groups (adding a few
> > groups along the way).
> >
> > And it all went wrong :-(
> >
> > Eventually I traced it down to the following ... and don't know if I'm
> > missing something or if I've bumped into a bug.
> >
> > The resize handler is
> >
> > > on resizeControl
> > >    set the width of field "list titles" of me to the width of me - 20
> > >    put "B" && the rect of me && the bottom of me &CR after msg
> > >    set the left of field "list titles" of me to 10
> > >    put "C" && the rect of me && the bottom of me &CR after msg
> > >    local tR
> > >    put 10, the top of me, the right of me -10, the bottom of me-10 into tR
> > >    set the rect of fld "List" of me to tR
> > > end resizeControl
> >
> > Note the two "put ... msg" statements. - for no reason I can figure out,
> > the "bottom of me" changes between these two statements. Here's the
> > output from the message box:
> >
> > > B 5,32,331,468 468
> > > C 6,32,325,2618 2618
> > > B 5,32,331,471 471
> > > C 5,32,320,2622 2622
> > > B 5,32,331,473 473
> > > C 5,32,320,2626 2626
> > >
> > If I comment out that "set the left of ..." statement, all apparently
> > works as expected.
> >
> > Why should setting the 'left' of a control change the bottom of its
> > enclosing group ?
> >
> > And why change it to an apparently silly value ?
> >
> > -- Alex.
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list