How to Reset ID's of Controls

Peter M. Brigham pmbrig at gmail.com
Wed Feb 5 13:24:15 EST 2014


On Jan 28, 2014, at 2:18 AM, Ender Nafi Elekcioglu wrote:

<snip>
> Mark:
> "> I have tens of cards, each one has hundreds of controls 
>> and I create those controls on each time the user navigates to those cards.
> 
> Why? When I need to do something like that I will most likely show/hide
> groups of controls rather than copying them or making them from scratch.
> That way you don't have to be concerned about the id pool, as nothing is
> being created or destroyed."
> 
> Stephen:
> "not to mention it would take more computing time to create and display 
> rather than show and hide."
> 
> 
> Ok, I'm open to new ideas here.
> This is a news app, so the content change dynamically.
> Which controls should I show/hide?
> I don't know beforehand how many images/fields my app will need.
> Every minute or so, a new content arrives 
> and I have to create a new group {thumbnail, header, summary} for it.
> 
> Is this a wrong approach, am I mistaking?

What is the max number of buttons that you would be likely to need? Take that number, increase by 50%, and create that number of buttons. Then show/hide them as needed, relabeling and/or renaming them if necessary.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list