Originally Posted by ravagernl
You're mixing lazy creation of a frame and toggling the same frame in the wrong way. You only need to toggle the frame if it was already created, otherwise you know that it isn't visible yet so you just need to create it.
Lua Code:
[...] function MyAddon_ShowOptionFrame() -- Does the frame already exist? if not HeeloWorldFrame then -- Nope. Create it now: CreateFrame("frame", "HeeloWorldFrame", UIParent) HeeloWorldFrame:SetWidth(300) HeeloWorldFrame:SetHeight(75) HeeloWorldFrame:SetPoint("CENTER", UIParent,"CENTER", 0, 0) HeeloWorldFrame:SetFrameStrata("BACKGROUND") HeeloWorldFrame:SetFrameLevel(1) HeeloWorldFrame:SetAlpha(1) HeeloWorldFrame:SetBackdrop(backdrop) else -- frame already exists, so toggle it. HeeloWorldFrame:SetShown(not HeeloWorldFrame:IsShown()) end end [...]
|
ok i know im new at this but now i feel like an utter idiot, thank you much!!!