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 events.

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. Something like:
```
local sPendingResizeId
constant kResizeTimeout = 20

on resizeStack pWidth, pHeight
   /* If there is already a deferred request to resize then cancel. */
   if sPendingResizeId is not empty then
      cancel sPendingResizeId
   end if

   /* Defer the request to resize for a further period. */
send "_doResizeStack pWidth, pHeight" to me in kResizeTimeout milliseconds
   put the result into sPendingResizeId
end resizeStack

on _doResizeStack pWidth, pHeight
   lock screen
   ... do relayout ...
   unlock screen
end _doResizeStack
```

This defers the relayout code until a resize stack message has not been sent for the timeout interval.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things

_______________________________________________
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