Thread Tools Display Modes
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
04-30-23, 09:42 PM   #2
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
In your SetPoint calls, you need to add the parent panel variable to anchor it to.

Since you are using the variable "panel"

for example:
Lua Code:
  1. title:SetPoint("TOP")

should really be

Lua Code:
  1. title:SetPoint("TOP", panel)

Also move the

Lua Code:
  1. InterfaceOptions_AddCategory(panel)

to the bottom of all of your panel code
__________________
My Addons: Convert Ratings Honor Track

Last edited by briskman3000 : 04-30-23 at 09:45 PM.
  Reply With Quote
04-30-23, 11:49 PM   #3
AeroMaxxD
An Aku'mai Servant
Join Date: Dec 2022
Posts: 33
I tried your changes but still doesn't work.

Lua Code:
  1. local panel = CreateFrame("Frame");
  2. panel.name = "MyAddOn";
  3.  
  4. -- Create the scrolling parent frame and size it to fit inside the texture
  5. local scrollFrame = CreateFrame("ScrollFrame", nil, panel, "UIPanelScrollFrameTemplate");
  6. scrollFrame:SetPoint("TOPLEFT", panel, "TOPLEFT", 3, -4);
  7. scrollFrame:SetPoint("BOTTOMRIGHT", panel, "BOTTOMRIGHT", -27, 4);
  8.  
  9. -- Create the scrolling child frame, set its width to fit, and give it an arbitrary minimum height (such as 1)
  10. local scrollChild = CreateFrame("Frame", nil, panel);
  11. scrollFrame:SetScrollChild(scrollChild);
  12. scrollChild:SetWidth(InterfaceOptionsFramePanelContainer:GetWidth()-18);
  13. scrollChild:SetHeight(1);
  14.  
  15. -- Add widgets to the scrolling child frame as desired
  16. local title = scrollChild:CreateFontString("ARTWORK", nil, "GameFontNormalLarge");
  17. title:SetPoint("TOP", scrollChild, "TOP");
  18. title:SetText("MyAddOn");
  19.  
  20. local footer = scrollChild:CreateFontString("ARTWORK", nil, "GameFontNormal");
  21. footer:SetPoint("TOP", scrollChild, "TOP", 0, -5000);
  22. footer:SetText("This is 5000 below the top, so the scrollChild automatically expanded.");
  23.  
  24. InterfaceOptions_AddCategory(panel);
  Reply With Quote
05-01-23, 07:46 AM   #4
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
Probably because you used "scrollChild" instead of "panel" in the SetPoint Calls.

Also you have a second instance of "TOP" in your footer SetPoint. That probably breaks something too.
__________________
My Addons: Convert Ratings Honor Track
  Reply With Quote
05-02-23, 02:12 PM   #5
AeroMaxxD
An Aku'mai Servant
Join Date: Dec 2022
Posts: 33
Originally Posted by briskman3000 View Post
Probably because you used "scrollChild" instead of "panel" in the SetPoint Calls.
Ok I will try that.

Originally Posted by briskman3000 View Post
Also you have a second instance of "TOP" in your footer SetPoint. That probably breaks something too.
The link say it's fine. It does that anyway when you omit it.

https://wowpedia.fandom.com/wiki/API...izing_SetPoint
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Using the Interface Options Addons panel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off