Refer to new group?

dunbarx at aol.com dunbarx at aol.com
Tue Aug 2 14:11:57 EDT 2016


Phil.


Grouping the first two buttons maximizes their layer numbers. I see no reference to this in the "group" entry in the dictionary, though perhaps this makes sense, in that those first two controls, by virtue of being grouped, are relegated frontwards in layer number. They are "newer" controls in that sense.


I think.


Craig Newman




create button "first"
    create button "second"
    create button "third"

    put the name of button 1
    group button 1 and button 2
    put CR & the name of button 1 after msg




-----Original Message-----
From: Phil Davis <revdev at pdslabs.net>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Tue, Aug 2, 2016 1:43 pm
Subject: Re: Refer to new group?

Not so. Try this:

    create button "first"
    create button "second"
    create button "third"

    put the name of button 1
    group button 1 and button 2
    put CR & the name of button 1 after msg

Under your scenario, I would expect the name of button 1 to be "first" 
both times we put the name. But the script yields this:

    button "first"
    button "third"

Certainly there may be cases where your scenario does happen, but my 
simple test is not one of those cases.  :-)

Regards -
Phil



On 8/2/16 10:10 AM, Jeanne A. E. DeVoto wrote:
> At 9:37 AM -0700 8/2/2016, Phil Davis wrote:
>> If you use the "owner" method of getting the group's ID, be sure you 
>> refer to the child control by ID - its number will *always* be 
>> changed by the act of grouping it.
>
> ... if you refer to it as "control N", but not if you refer to it as 
> "field N" (or "button N", etc).
>
> _______________________________________________
> 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
>

-- 
Phil Davis

_______________________________________________
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