J. Landman Gay wrote:

> On 8/19/18 11:45 PM, Richard Gaskin via use-livecode wrote:
>> Consider a Note app.  At the top is a navbar that spans the width of
>> the device at 60 px tall; below is a field for the user to type in;
>> centered below that is a "Save" button.
>>
>> This is in the card script:
>>
>> on resizeStack x,y
>>    set the rect of grp "Navbar" to 0,0,x,60
>>    set the rect of fld "Main" to 0,the bottom of grp "Nav",x,y-100
>>    set the loc of btn "Save" to (item 1 of the loc of this cd, y-40)
>> end resizeStack
>
> Yup. Would you do this for, say, 200 controls per card on 1000 unique
> cards? Toss in a handful of groups nested three deep each. (I have
> Swami's project in mind.)

Swami asked for a simple example.  That was all I delivered.

Swami has not asked me to evaluate strategies for precise control of his layouts. That would not be possible until I see how things are constructed.

Just yesterday I delivered a UI with several hundred controls on a card, some quite deeply nested within groups. But the layout did not require writing anywhere close to one line per object. Some was handled in loops, others handled by simply grouping objects and placing the group. Some don't need to be moved at all because their natural placement relative to topleft need not change. Others were handled by combinations of the above in reusable behaviors.

But for every option there is an edge case. It may be that his app is so unusual as to be completely unconstructable using the methods most apps and web sites are made with.

As we see in the other thread today on performance of arrays vs chunks, so much depends on details, and there is rarely any one best answer for all possible cases.

If what he has is done and working and he's happy with it, regardless of the method use that would seem a good measure of his chosen method's fitness for that task.


Two general observations about resizing:

- We write thousands of lines of code in our apps, for everything from data storage to image manipulation and everything else. And for all those thousands of lines, no one complains about any of that - except for the only part the user directly interacts with, the UI. When we consider the widespread availability of data binding options in other systems, you'd think the tediousness of dealing with translating between LiveCode Script and SQL statements, and the repetitiveness of hand-crafting two-way bindings would be a more popular pet peeve. But no, folks are happy to write tons of code for that. And for everything else. We're scripters; we generally enjoy scripting. But reasons I don't yet understand, writing the relatively small part of the code to deliver a precise UI annoys people to the point of spending a multiple of the time the task requires trying to find ways of avoiding the task.

- In this thread we have at least half a dozen people, including two from the core team, all working together to explore various options for placing one object within a resizing method chosen for its ostensible ease of use. :)

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to