Instantiaing Grouped Controls - Templates - Responsive

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Jun 12 13:30:52 EDT 2017


@ Richard

1) Again, all very nice theory

Viz-a-viz my lament… "where are all the examples, sample code" We all don't live it the stratosphere of visionary LiveCode architecture like you doi. -☺

Can you post sample stacks with your resize handlers?

2) I like everything you are describing but I don't get this: "resizeControl"  is never triggered if the resizeStack is "dormant"  that was my last "problem"  … so, how are we "trigger" the resizeStack to "fire" when any stack is opened… even if the size doesn't change. 

a) if a stack is 414 X 736, and opens on a device that is 414 X 736  with full screen mode set to showAll… is the resizeStack handler fired?

b) how can we emulate this on the desktop during development if all your stacks are fixed size on the desktop and for deployment to mobile?




On 6/12/17, 5:02 AM, "use-livecode on behalf of Richard Gaskin via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    The resizeStack message should be sent in response to anything that 
    causes the stack to resize.
    
    This should not be limited to the user action of resizing a stack as we 
    often handle in desktop apps, but also whenever any script or the engine 
    causes the stack to resize.
    
    On mobile OSes, a stack can only fill the device screen size, so a 
    resizeStack handler should be sent when a stack is first opened, and 
    when orientation changes, two events that cause the stack to be resized.
    
    If the resizeStack message is used to adjust the rects of component 
    sections of the layout (groups), those groups should then be able to 
    adjust their interior contents in a resizeControl handler.
    
    With such a setup the layout-specific code only adjusts the rects of a 
    relatively few groups, and from there the groups take care of 
    themselves.  When any reusable groups are driven by behavior scripts, 
    code in one place allows reuse across nearly any UI.
    
    FWIW I just added an answer dialog in my test stack's resizeStack 
    handler and indeed it triggers on both app open and device rotate as 
    described above.  I'm using an engine for that testing built on v9.0dp4. 
    Since I'm testing on Android right now, if you're not seeing resizeStack 
    sent at app open and device rotate you may have found a bug specific to iOS.
    
    
    It seems you've found a satisfying alternative here, so if it does what 
    you need use it:



More information about the use-livecode mailing list