Moving a stack with no controls

Mark Schonewille m.schonewille at
Thu Jul 19 14:49:34 EDT 2012


This is a FAQ. Here's some really old code. Change myMenuCorrection as required.

on grabWindow
  if the platform is "MacOS" then
    put 22 into myMenuCorrection
    put 0 into myMenuCorrection
  end if
  lock messages
  put (trunc(the width of this window/2) - the mouseH) into difH
  put (trunc(the height of this window/2) - the mouseV) into difV
  repeat until the mouse is up
    put the loc of this window into loc1
    put the screenMouseLoc into loc2
    add difH to item 1 of loc2
     add (difV + myMenuCorrection) to item 2 of loc2
    -- add (difV ) to item 2 of loc2
    if loc1 is not loc2 then set the loc of this window to loc2
  end repeat
  unlock messages
end grabWindow

Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
KvK: 50277553

Economy-x-Talk is looking for an amateur painter/cartoonist/poet etc. Contact me

On 19 jul 2012, at 20:35, Magicgate Software - Skip Kimpel wrote:

> I have a stack that has a custom shape so that when it runs it has a
> transparent background.  Since it has no controls at the top as you
> would normally have in a main stack, is there a way to allow the user
> to drag and move the stack around the screen at run time?

More information about the Use-livecode mailing list