I've got this part working slightly but running into a problem. I have a checkbox and I'm trying to lock the frame. Problem is when you click the checkbox it locks the frame but when you un check the box it will not unlock my frame. I know it's in my function I'm just not sure what I'm doing wrong here.
LUA
Lua Code:
barQWindowLockCheckButton = CreateFrame("CheckButton", "barQWindowLockCheckButton_GlobalName", ZBarOptionFrame, "ChatConfigCheckButtonTemplate");
barQWindowLockCheckButton:SetPoint("TOPLEFT", 25, -145);
barQWindowLockCheckButton_GlobalNameText:SetText("Frame 1 Lock");
barQWindowLockCheckButton.tooltip = "This is will lock the frame in place.";
barQWindowLockCheckButton:SetScript("OnClick",
function()
if barQWindow:SetMovable(true) then
barQWindow:SetMovable(true)
else
barQWindow:SetMovable(false)
end
end
);
So can anyone tell me what I'm doing wrong here?