Page 1 of 1

liveResizing on Windows

Posted: Sat Aug 13, 2016 2:21 pm
by rinzwind
This property does nothing on Windows which is a shame because sometimes it makes sense to not constantly update the screen when resizing.

I found a hacky but working way to make this work and want to share it.

Add this code in the main stack:

Code: Select all

on resizeStack nw, nh, ow, oh, force
   if force or the liveResizing of this stack then
      pass resizeStack
   end if
   if "afterResize" is not in the pendingMessages then
      send "afterResize" to the target in 1 tick
   end if
end resizeStack

on afterResize
   dispatch "resizeStack" to the target with the width of me, the height of me, the width of me, the height of me, true
end afterResize
The result is that any (sub)stack with liveResizing set to false only updates its card layout after the resize event.

Re: liveResizing on Windows

Posted: Sat Aug 13, 2016 2:45 pm
by FourthWorld
Live resizing has been the Windows default for many years. It's also been the default on OS X for long enough that the property has been deprecated in v8.1 and later. Changing that behavior may make your app appear odd to users. What's happening with your layout that makes live resizing undesirable?

Re: liveResizing on Windows

Posted: Sat Aug 13, 2016 2:54 pm
by rinzwind
If one has a complex GUI, especially when using a datagrid with many columns the resizing goes very jerky... that's why I think its better in that case to only update the layout after resize. Anyway, the property is there, has an checkbox but doesn't work by default which is kind of stupid. Well... maybe it IS gone in LC8, but above does still work of course.

Re: liveResizing on Windows

Posted: Sat Aug 13, 2016 3:18 pm
by FourthWorld
rinzwind wrote:...the property is there, has an checkbox but doesn't work by default which is kind of stupid. Well... maybe it IS gone in LC8
I don't see that in v8.1. Which Inspector pane are you finding that in?

Re: liveResizing on Windows

Posted: Sat Aug 13, 2016 4:11 pm
by rinzwind
Thats what I said/meant. I just saw they removed the inspector element for the Live Resizing property in LC8 (it didnt do anything anyway as I found out). It was there up to the last version of LC7. Above code still works to get the behavior. If liveResizing is false while this code is added, you do see the card background/edge gets resized, but geometry manager stuff waits until youre done resizing wich in some cases is useful for performance/gui smoothness reasons.