Thread Tools Display Modes
04-25-20, 02:07 PM   #1
MinguasBeef
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 51
Automatically expand interface options?

I have it when I type in a slash command, that it pulls up the interface options for the main panel with

Code:
InterfaceOptionsFrame_OpenToCategory("Minguas Suite")
I have subcategories within this panel however, and I always have to manually expand this panel to see the others. Is there any way to have it automatically expand the panel to see the subcategories?

Thanks
  Reply With Quote
04-25-20, 06:46 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The function takes either the exact string you set as panel.name, but can also take panel itself. I'd recommend calling it with the later to prevent name collisions.

Note: This works for both your main panel and your subcategory panels.
(See InterfaceOptionsFrame.lua:418)
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 04-25-20 at 06:54 PM.
  Reply With Quote
04-25-20, 08:14 PM   #3
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Open to one of the subcategories first:
Code:
InterfaceOptionsFrame_OpenToCategory("Minguas Suite - Subcategory")
InterfaceOptionsFrame_OpenToCategory("Minguas Suite")
Obviously the first line will need to be changed to whatever your code is set up for but you should get the idea.
  Reply With Quote
04-26-20, 11:11 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by Vrul View Post
Code:
InterfaceOptionsFrame_OpenToCategory("Minguas Suite - Subcategory")
Unless the subcategory is actually named "Minguas Suite - Subcategory", it won't work. If it's named "Subcategory", then you have to refer to it as "Subcategory". This opens the possibility of name collisions since another addon may register that name as well. This is why you should pass the pointer to the panel itself instead.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 04-26-20 at 11:14 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Automatically expand interface options?

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