WoW:Making Draggable Frames: Difference between revisions

no edit summary
m (→‎Parent Dragging: Updated - We now have the SetMovable widget function)
No edit summary
Line 85: Line 85:


This way, your <Frame> can still receive mouse events, and you can only drag it by clicking within its <TitleRegion>.
This way, your <Frame> can still receive mouse events, and you can only drag it by clicking within its <TitleRegion>.
== Lua Only Approach ==
If your frame is called MyFrame -
MyFrame:SetMovable(true)
MyFrame:EnableMouse(true)
MyFrame:SetScript("OnMouseDown",function()
  MyFrame:StartMoving()
end)
MyFrame:SetScript("OnMouseUp",function()
  MyFrame:StopMovingOrSizing()
end)


[[Category: HOWTOs|Make a Frame Draggable]]
[[Category: HOWTOs|Make a Frame Draggable]]
Anonymous user