controlNames deprecated??

Bob Sneidar bobsneidar at iotecdigital.com
Fri Jul 28 14:33:54 EDT 2017


Hi Jacque. 

My growing consternation is that I have a LOT more lines in the list than show up in the application browser. But I suppose I have a lot of groups within groups so okay. 

What I am actually trying to do is get a list of every visible object on a card so I can set the windows size to encompass all VISIBLE objects. I need to take into account group borders though, because a group on one side of the card will produce a larger visible distance that the other side (if it contained no groups or objects with margins). 

The idea is to have a function which automatically sizes a card to encompass all visible objects with extra margins on the 4 sides. I say visible because the menuBar is typically invisible on the Mac OS, and I do not want to include that, nor do I care about imported graphics I have hidden, like the one I use for my background patters for instance. 

It seems there ought to be a way to get the names of all visible objects on a card without having to loop through every single field (think datagrids and shudder) or button (think menubars and shudder some more) or group (think datagrids again containing groups within groups and run screaming naked into the hills). 

Bob S


> On Jul 28, 2017, at 11:21 , J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> On 7/28/17 12:52 PM, Bob Sneidar via use-livecode wrote:
>> I can get the controlnames of a card, but at first blush the list does not include button names. However it*does*  list a great many numbers of 4 digits. So I tried looking up controlNames in the dictionary and there is no entry for it, at least not by using the find function.
> 
> 
> I just tested this and it looks like the controlNames of a card only return the names of controls whose parent is the card. Controls within a group are listed by ID. I'm not sure if this is correct or not, I can see the logic, but it would seem if the parent has to be the card then controls within a group shouldn't be in the list at all.
> 
> My test card used a background group; it might be different for a card group.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com





More information about the Use-livecode mailing list