Detecting when resizeStack is completed
mark at livecode.com
Fri Aug 18 12:29:47 EDT 2023
On 2023-08-18 17:03, David Epstein via use-livecode wrote:
> How can I redraw objects after the user has resized the stack, but not
> continuously during the resize? Releasing the mouse at the end of a
> resize does not appear to send a mouseUp message.
Normal window resizing is handled by the OS, so doesn't generate mouse
One way to get close to what you request is to only relayout your
objects if the user has not changed the size within a short period.
constant kResizeTimeout = 20
on resizeStack pWidth, pHeight
/* If there is already a deferred request to resize then cancel. */
if sPendingResizeId is not empty then
/* Defer the request to resize for a further period. */
send "_doResizeStack pWidth, pHeight" to me in kResizeTimeout
put the result into sPendingResizeId
on _doResizeStack pWidth, pHeight
... do relayout ...
This defers the relayout code until a resize stack message has not been
sent for the timeout interval.
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things
More information about the use-livecode