The the name you give a frame is entered into the global table as a reference to that frame. If I remember correctly, the first frame with a given name gets the global table variable.
If you have more than one frame called TestFrame then running TestFrame:SetShown(not TesFrame:IsShown()) will toggle the first TestFrame created which may not be yours or more likely is one of the other 50 TestFrames you've got sitting in long forgotten test code.
Giving unique names to anything created as a global is good advice as you're sharing that space with all other addons including the entire Blizzard default UI.
|