View Single Post
03/27/23, 07:57 PM   #32
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
But my post above explains how to detect it's YOUR addon panel that was created, or opened...
>myPanel is the variable that your addon settings panel returns as you create it via function LibAddonMenu2:RegisterAddonPanel(yourPanelName, yourPanelData) !
---> local myPanel
--- do addon options etc and add it to yourPanelData
---- ... addon controls here
---myPanel = LibAddonMenu2:RegisterAddonPanel(yourPanelName, yourPanelData)
--in the callback functions check for the parameter panel of the callbacks == myPanel or else return

All you need to do now is use the 2 callbacks, "controls created" and "panel opened", check for your panel or else return (as it's another panel then) and then update your descriptions data and use UpdateValue to force the update on it.

I had prepared all that for you already, you just need to take the time and read it, read the Wiki, and try to understand it. If you do not understand it, ask as adviced, instead of reinventing the wheel (which sometimes makes sense for a learning effect but will result in errors in longterm).

Last edited by Baertram : 03/27/23 at 08:00 PM.
  Reply With Quote