Drag a window without a title bar
Bill Vlahos
bvlahos at mac.com
Thu Jun 2 17:36:40 EDT 2011
Mark,
As Richard Gaskin would say, "It works a treat."
Thank you,
Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
On Jun 2, 2011, at 1:22 PM, Mark Schonewille wrote:
> Bill,
>
> here's mine...
>
> on mouseDown
> if "button" is not in the name of the target then grabWindow
> else pass mouseDown
> end mouseDown
>
> on grabWindow
> if the platform is "MacOS" and (the decorations of the \
> defaultStack contains "title" or the decorations of the \
> defaultStack is "default") then
> put 22 into myMenuCorrection
> else
> put 0 into myMenuCorrection
> end if
> put "10,10,310,310" into myRect
> add myMenuCorrection to item 2 of myRect
> lock messages
> put (trunc(the width of this window/2) - the mouseH) into difH
> put (trunc(the height of this window/2) - the mouseV) into difV
> repeat until the mouse is up
> put the loc of this window into loc1
> put the screenMouseLoc into loc2
> add difH to item 1 of loc2
> add (difV + myMenuCorrection) to item 2 of loc2
> -- add (difV ) to item 2 of loc2
> if loc1 is not loc2 then set the loc of this window to loc2
> end repeat
> unlock messages
> end grabWindow
>
> You may want to adjust the mouseDown handler.
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
>
> New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce
>
> On 2 jun 2011, at 21:33, Bill Vlahos wrote:
>
>> 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