Okay.
Which one of these were you hoping to implement ? Each one will involve different set up and calls to show up.
1. Display Panel in pre Dragonflight InterfaceOptionsFrame
Use example in
https://warcraft.wiki.gg/wiki/Using_...s_Addons_panel to make sure your panel is correctly set up to work with the Interface Options Addons Panel system. And then use
`InterfaceOptionsFrame_OpenToCategory(panel)` to open the frame when you click your button ( you might have to call it twice for it to work as per the comment in the small print at the bottom. It will have a close button to close it again - no need to toggle.
2. Display your own custom panel on the main screen like any other frame you create.
In this case, make sure your frame has a background/backdrop and any other controls it needs. And then you can use the following function to toggle your panel to show or hide based on its current status when you click your button.
Example Code:
Lua Code:
local function TogglePanel(panel)
if panel:IsShown() then
panel:Hide()
else
panel:Show()
end
end function
But you would have to change this
Lua Code:
local panel = CreateFrame("Frame", "MyAddonOptionsPanel", InterfaceOptionsFrame)
-- Rest of your panel creation code
To this
Lua Code:
local panel = CreateFrame("Frame", "MyAddonOptionsPanel",UIParent)
-- Rest of your panel creation code
3. Have your panel show up as part of the Dragonflight SettingsPanel
https://warcraft.wiki.gg/wiki/Patch_10.0.0/API_changes gives you some sort of example on how to set up your frame to be part of the settings panel. But not an example on how to jump to your panel.
There is a similar Settings.OpenToCategory() function which Fizzle points to in
https://www.wowinterface.com/forums/...11&postcount=2 but it only goes to the AddOns tab and not a particular AddOns panel.