Moving a window without a dragbar...

Chipp Walters chipp at
Mon Dec 3 23:41:00 EST 2001

I'm writing a little handler to move a window by clicking on it and
dragging. I've inserted the following into the stack script:

local startX,startY,dragWd

on mouseDown
  put true into dragWd
  put the mouseH into startX
  put the mouseV into startY
end mouseDown

on mouseMove newMouseH, newMouseV
  if dragWd then
    set the loc of this stack to \
		item 1 of the loc of this stack - startX + newMouseH, \
		item 2 of the loc of this stack - startY + newMouseV
  end if
end mouseMove

on mouseUp
  put false into dragWd
end mouseUp

on mouseRelease
  put false into dragWd
end mouseRelease

on mouseLeave
  put false into dragWd
end mouseLeave

This way you can build a project with no window borders or titlebar, and
have it still be dragged around the screen. How can I get buttons to not
react to the handlers above without explicitly coding "catch" handlers?

More information about the use-livecode mailing list