General about hiding frames[]
To hide a frame, you have to enter the frame name, followed by the command :Hide()
Example:
MyFrame:Hide()
Hides a frame called "MyFrame".
If you use this in a Macro (not in an Addon), you have to add a /script-tag before:
/script MyFrame:Hide()
[]
MyFrame:Show()
NOTE: Most frames have event handlers so even if you hide it, it can pop back up as a result of an event handler calling it's Show function. To avoid this you need to prevent the frame from getting these events or from executing the code that makes the frame show. Most Blizzard's frames (if not all) use the a single function to handle all events, which makes it easier for us. When hidding the frame you can make the OnEvent fucntion point to nill so no function gets called:
PlayerFrame:SetScript("OnEvent", nil); PlayerFrame:Hide();
And then restore the original function when you want to show the frame again:
PlayerFrame:SetScript("OnEvent", PlayerFrame_OnEvent); PlayerFrame:Show();
You will have to go through the code for each frame to get the exact functions, and with some (like target or pet) do some checks before actually showing it, i.e. Make sure the unit exists.
The following table lists the names of some frames that you may wish to hide or show, along with the Blizzard function used to hide them, if one is provided:
Frame | Name | Blizzard function |
---|---|---|
Player Frame | PlayerFrame | |
Party Member Frame X | PartyMemberFrameX | |
All Party Member Frames | HidePartyFrame() | |
Minimap, including buttons | MinimapCluster | |
World Map Minimap Button | MiniMapWorldMapButton | |
Calendar Minimap Button | GameTimeFrame | |
Zoom In Minimap Button | MinimapZoomIn | |
Zoom Out Minimap Button | MinimapZoomOut | |
Main Action Bar | RemoveMainActionBar() | |
Main Menu Bar | MainMenuBar | |
Left Gryphon | MainMenuBarLeftEndCap | |
Right Gryphon | MainMenuBarRightEndCap | |
Shapeshift/Stance Bar | ShapeshiftBarFrame | |
Bottom-left Action Bar | MultiBarBottomLeft | |
Bottom-right Action Bar | MultiBarBottomRight | |
Left Action Bar | MultiBarLeft | |
Right Action Bar | MultiBarRight | |
Everything | UIParent | |
Default Chat Frame | ChatFrame1 | |
Chat Frame X | ChatFrameX | |
Experience Bar | MainMenuExpBar |