Dragging a window

Scott Rossi scott at tactilemedia.com
Mon Aug 5 12:09:01 CDT 2002


Recently, "Matt Denton"  wrote:

> does anyone know if you can 'drag' a window around
> from an object other than its titlebar?

Sure -- several ways, all based on the same principle.  The following works
for me, placed in the object that is clicked to initiate the drag:

on mouseDown
  set the uAllowDrag of me to the mouseH & "," & the mouseV
end mouseDown

on mouseMove x,y
  if the uAllowDrag of me is empty then exit mouseMove
  put globalLoc(x & "," & y) into tLoc
  set topLeft of this stack to \
      item 1 of tLoc - item 1 of the uAllowDrag of me,\
      item 2 of tLoc - item 2 of the uALlowDrag of me
end mouseMove

on mouseUp
  set the uAllowDrag of me to empty
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list