I have tried everything you've suggested also I've flipped things around re-named my frame and it's still not working. My button that I made in the code isn't working with a right click to show and hide the window. Any way here is the code as of right now. Still don't know what I'm doing wrong yet.
Lua Code:
--Want to add Show Hide function for each window. ( barQWindow, barAWindow, barMWindow, barCWindow )
--With the Show Hide I want to add this in an addon options window.
--Want to add a lock frame for each window.
--With lock frame I want to add this in an addon options window.
--Create a button using lua that pulls up a window for ZBar Options.
-- creates a generic button in the middle of the screen --
ZBarButton = CreateFrame("Button","ZBarButton",UIParent,"UIPanelButtonTemplate")
ZBarButton:SetPoint("CENTER",0,0)
ZBarButton:SetWidth(30)
ZBarButton:SetHeight(30)
ZBarButton:SetText("ZB")
ZBarButton:SetMovable(true)
ZBarButton:RegisterForDrag("LeftButton")
ZBarButton:SetScript("OnDragStart",ZBarButton.StartMoving)
ZBarButton:SetScript("OnDragStop",ZBarButton.StopMovingOrSizing)
ZBarOptionFrame = CreateFrame("Frame")
ZBarOptionFrame:ClearAllPoints()
ZBarOptionFrame:SetBackdrop(StaticPopup1:GetBackdrop())
ZBarOptionFrame:SetHeight(300)
ZBarOptionFrame:SetWidth(300)
ZBarOptionFrame:Hide(true)
ZBarOptionFrame.text = ZBarOptionFrame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
ZBarOptionFrame.text:SetAllPoints()
ZBarOptionFrame.text:SetText("ZBar Options Verison 1.0")
ZBarOptionFrame:SetPoint("CENTER", 0, 0)
local frame = CreateFrame("Button", nil, UIParent)
frame:RegisterForClicks("AnyUp")
frame:SetScript("OnClick", function(self, button, ...)
if (button == "RightButton") then
if frame:IsShown() then
frame:Hide()
else
frame:Show()
end
end
end)