How to drag window when windowshape is used?

Scott Rossi scott at tactilemedia.com
Tue Jul 8 19:55:01 EDT 2003


Recently, RGould8 at aol.com wrote:

> Does anyone have any sample "fake title-bar dragging" code they could share
> that allows the user to move a window via an object on a card, instead of the
> titlebar?

Place this in your drag control:

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
  set the topLeft of this stack to \
     globalLoc(x - item 1 of the uAllowDrag of me & "," & \
     y - 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
Email: scott at tactilemedia.com
Web: www.tactilemedia.com




More information about the use-livecode mailing list