Moving a Custom Shaped window

Geoff Canyon gcanyon at inspiredlogic.com
Tue Jun 7 06:06:06 EDT 2005


On Jun 6, 2005, at 4:50 PM, zack wrote:

> What a snap it is to create a custom shaped window!  Really cool.   
> But how do make it so the user can still drag the window around  
> their desktop?  I can't seem to grab any part of it to move it.

The mouseMove message gives you the mouse x and y as arguments, so  
you can use those values:

local sClickLoc

on mouseDown -- start dragging the stack
   put the mouseLoc into sClickLoc
end mouseDown

on mouseMove x,y -- handle dragging if the user is dragging the stack
   if sClickLoc is empty then exit mouseMove else get the loc of this  
stack
   set the loc of this stack to \
     (item 1 of it + x - item 1 of sClickLoc),(item 2 of it + y -  
item 2 of sClickLoc)
end mouseMove

on mouseUp
   put empty into sClickLoc
end mouseUp

on mouseRelease
   put empty into sClickLoc
end mouseRelease




More information about the use-livecode mailing list