do something after resize stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2423
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

do something after resize stack

Post by jmburnod » Sun Feb 19, 2017 7:33 pm

Hi All,
I search a way to send a message AFTER a resize stack is done.
I found a quick and a little dirty workaround
It using a local variable = true when resizing is done and a mouseenter sends a message and set the local variable to false.
Thanks for yours ideas cleaner than mine
Best regards
Jean-Marc

rinzwind
Posts: 134
Joined: Tue May 01, 2012 10:44 am

Re: do something after resize stack

Post by rinzwind » Sun Feb 19, 2017 7:36 pm

on afterResize?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3333
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: do something after resize stack

Post by bn » Sun Feb 19, 2017 8:49 pm

Hi Jean-Marc,

I check for the mouse being not down = then resizing ended.

put this script into the card script of a new stack with 1 card and 1 field.

Code: Select all

local sResizeIsGoingOn = false

on resizeStack
   
   -- stuff you do inside resizeStack here
   
   if not sResizeIsGoingOn then
      send checkEndResize to me in 0 milliseconds
      put true into sResizeIsGoingOn
     put "Resizing started " & the long time into field 1
   end if
end resizeStack

on checkEndResize
   if not sResizeIsGoingOn then exit checkEndResize
   if the mouse is down then
      send checkEndResize to me in 50 milliseconds
   else
      put false into sResizeIsGoingOn
      put cr & "Resizing ended " & the long time after field 1
      
      -- Do your stuff for after resizing has finished here
      
   end if
end checkEndResize
Kind regards
Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2423
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: do something after resize stack

Post by jmburnod » Mon Feb 20, 2017 4:12 pm

Hi Bernd,
Thanks again
I tested it in my context and it work fine.
Kind regards
Jean-Marc

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”