drag a title-less palette stack

Scott Rossi scott at tactilemedia.com
Sun May 7 13:24:22 EDT 2006

Recently, betypaul wrote:

> I need a script so that a palette stack without a title bar  can be
> dragged around with a mouseDown within the stack?.

Many folks here have a variation of this.  Here's one, to be placed in an
object that will serve as your titlebar or similar:

(watch line wrap)

local allowDrag
on mouseDown
  put mouseLoc() into allowDrag
end mouseDown

on mouseMove X,Y
  if allowDrag = "" then exit mouseMove
  set topLeft of this stack to globalLoc(X - item 1 of allowDrag & "," & Y -
item 2 of allowDrag)
end mouseMove

on mouseUp
  put "" into allowDrag
end mouseUp

on mouseRelease
end mouseRelease


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