Changing position/dimensions of a control that is part of a group

Alex Tweedly alex at tweedly.net
Thu Jan 28 18:29:41 EST 2016


As Mark Weider said, control ids are unique, so there is no need to 
specify the group, in
    ... graphic id 1234 of grp "unneeded" of ..

However, the same is not true of names, so it's perfectly possible to 
have multiple graphics (or multiple groups) within the card, each with 
the same name. It is therefore ambiguous which of them is being referred 
to -and unfortunately the engine does NOT inform you of this ambiguity 
(and hence possible bug).

So - in your original example here -

  set the width of graphic "BaseControlsBkgnd" to item 3 of tCardRect

are you sure there s no other graphic with the same name ?  (- NB it can 
be anywhere withing the stack file)

Ir would be better practice to say somethingglike

  set the width of graphic "BaseControlsBkgnd" of grp "wherever" of grp :to item 3 of tCardRect


-- Alex.

On 28/01/2016 04:13, Sannyasin Brahmanathaswami wrote:
> I take part of that back
>
>
>   set the width of graphic id 1026 of grp "baseControls" to item 3 of tCardRectByStack
>
>       set the left of  graphic id 1026 of grp "baseControls" to 0
>
>
> works
>
>
> but not if we refer to the graphic by name
>
> http://www.himalayanacademy.com/apps/gurudeva
>
>
> On January 27, 2016 at 6:08:03 PM, Sannyasin Brahmanathaswami (brahma at hindu.org<mailto:brahma at hindu.org>) wrote:
>
> These lines are causing my scripts to silently fail…
>
>
>   set the width of graphic "BaseControlsBkgnd" to item 3 of tCardRect
>
>   set the left of graphic  id 1026  to 0
>
>
> either one will break the script whether referred to by name or ID…
>
> I thought I recalled some internal global to allow controls in a group to be dynamically managed… but it only appears to refer to layers and not geometric position or dimensions.
>
>
> Oddly there is no error msg to alert us that there is a problem here.
>
>
> Neither the group or the graphic which is part of it have their lockloc set to true.
>
>
>
>
>
>
> BR
> _______________________________________________
> 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