Drag a window without a title bar

Marty Knapp martyknapp at comcast.net
Thu Jun 2 15:43:26 EDT 2011


Hey Bill,

I use the following - probably gleaned from Scott Rossi. Put it in the 
stack or card script:

local allowDrag
on mouseEnter
      put "" into allowDrag
end mouseEnter

on mouseDown
    if word 1 of the target = "card" then 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
      put "" into allowDrag
end mouseRelease


Marty Knapp
> I have a stack that uses the windowshape property so it no longer has the title bar. What is the handler I should use to allow the user to drag the stack around? I have a background image that the user could click and drag for moving the window.
>
> Thanks,
> Bill Vlahos
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list