How do I script the process of the user dragging the window around when it's in a custom windowShape and has no title bar?
(I've tried searching here, but it's a bit difficult when the forum won't let me search for "window"!

k
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
local sDownDelta
on mouseDown
put the clickloc into sDownDelta
end mouseDown
on mouseMove
if sDownDelta is not empty then
put item 1 of the screenMouseLoc into x
put item 2 of the screenMouseLoc into y
switch the platform
case "MacOS"
put item 2 of the windowBoundingRect into tMinY
break
case "Linux"
put 24+ item 2 of the screenRect into tMinY
break
case "Win32"
put 0 into tMinY
end switch
put item 1 of the windowBoundingRect into tMinX
--
set the topleft of this stack to \
max(tMinX, (x-item 1 of sDownDelta)),\
max(tMinY, (y-item 2 of sDownDelta) )
end if
end mouseMove
on mouseRelease
put empty into sDownDelta
end mouseRelease
on mouseUp
put empty into sDownDelta
end mouseUp
Code: Select all
local tOffset
on mouseDown
put the mouseLoc into tOffset
end mouseDown
on mouseMove
put the loc of this stack into tScreen
put the mouseLoc into tMouse
set the loc of this stack to item 1 of tScreen + item 1 of tMouse - item 1 of tOffset & "," & item 2 of tScreen + item 2 of tMouse - item 2 of tOffset
end mouseMove