Number of Controls - Application Browser vs. Script

Pete pete at mollysrevenge.com
Wed Nov 16 16:39:46 EST 2011


Hi Glen,
I haven't found a way to exclude them from being returned by any of the
standard methods of looping through the controls in a script but I have
managed to identify which controls are part of the datagrid.

If it helps, you can see the structure of a datagrid by selecting it, then
in the message box, type:

set the selectgroupedcontrols of selobj() to true

Then select the card that the datagrid is on in the Application browser (if
it's already selected, you'll probably have to refresh the right pane by
right-clicking and selecting refresh.

Your datagrid won't work until you restore it to normal condition by "set
the selectgroupedcontrols of selobj() to false"

You'll see that many (but not all) of the datagrid controls have names that
begin with "dg" so you can start by excluding those.  After that, you have
to deal with any columns that you have customised to contain controls and
the column headings since they won't have names that begin with "dg"
(unless you force yourself to do that).  I do that by checking if either
"dgList" or "dgHeader" is in the long name of the control.  So far that has
worked reliably for me.

Hope that helps.


Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Wed, Nov 16, 2011 at 12:14 PM, Glen Bojsza <gbojsza at gmail.com> wrote:

> I have a stack with a single card and several objects that I have placed on
> it ... including a datagrid.
>
> In the application browser it shows 58 controls for the card (all the ones
> I expected).
>
> From script
>
> put the number of controls of card 1 of this stack
>
> I get 202 controls (which I would guess has to do with the datagrid).
>
> Is it possible via script to get the same controls that the Application
> browser reports?
>
> thanks
> _______________________________________________
> 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