View Single Post
04-30-23, 06:27 AM   #1
AeroMaxxD
An Aku'mai Servant
Join Date: Dec 2022
Posts: 33
Using the Interface Options Addons panel

I'm wanting to use the Interface Options Addons Panel on my new addon.

I create a test addon with the code below which is an example from https://wowpedia.fandom.com/wiki/Usi...s_Addons_panel but this only partially works.

For example I get a scroll bar in the interface options, but I don't get any text within the options pane this creates, and thus also not able to use the scroll bar as there is nothing to scroll.

Lua Code:
  1. local panel = CreateFrame("Frame")
  2. panel.name = "MyAddOn"
  3. InterfaceOptions_AddCategory(panel)
  4.  
  5. -- Create the scrolling parent frame and size it to fit inside the texture
  6. local scrollFrame = CreateFrame("ScrollFrame", nil, panel, "UIPanelScrollFrameTemplate")
  7. scrollFrame:SetPoint("TOPLEFT", 3, -4)
  8. scrollFrame:SetPoint("BOTTOMRIGHT", -27, 4)
  9.  
  10. -- Create the scrolling child frame, set its width to fit, and give it an arbitrary minimum height (such as 1)
  11. local scrollChild = CreateFrame("Frame")
  12. scrollFrame:SetScrollChild(scrollChild)
  13. scrollChild:SetWidth(InterfaceOptionsFramePanelContainer:GetWidth()-18)
  14. scrollChild:SetHeight(1)
  15.  
  16. -- Add widgets to the scrolling child frame as desired
  17. local title = scrollChild:CreateFontString("ARTWORK", nil, "GameFontNormalLarge")
  18. title:SetPoint("TOP")
  19. title:SetText("MyAddOn")
  20.  
  21. local footer = scrollChild:CreateFontString("ARTWORK", nil, "GameFontNormal")
  22. footer:SetPoint("TOP", 0, -5000)
  23. footer:SetText("This is 5000 below the top, so the scrollChild automatically expanded.")
  Reply With Quote