Talk:Making draggable frames

Its all very well that we can drag frames around.... But this can in some circumstanses make the frame disapear (for instance when changing resolution). So how would one move a frame that cant be reached by mouse? One possibility would be to make a slash command that moves the frame to a default position... Im yet to find a way to do this. I have tried stuff like getglobal():SetPoint("CENTER","UIParent","CENTER",0,0) but this does not seem to work. Maisha - 23 March 2006

Answer
If u do a getglobal():ClearAllPoints before using SetPoint(...) it will work..

Just found out

Maisha - 23 March 2006 a little later than first post

Draggable Frames in Vanilla
How to move the unit frames without using an addon

Examples:

Move player unit frame:

/script PlayerFrame:SetMovable(1)PlayerFrame:StartMoving — Then move around your mouse and the frame will move.

Stop moving player unit frame:

/script PlayerFrame:StopMovingOrSizingPlayerFrame:SetMovable

Move target unit frame:

/script TargetFrame:SetMovable(1)TargetFrame:StartMoving

Stop moving target unit frame:

/script TargetFrame:StopMovingOrSizingTargetFrame:SetMovable

Target of target will move after the target unit frame

P.S. Сode to get the name of mouseover frame:

/script ChatFrame1:AddMessage("frame name: " .. GetMouseFocus:GetName)