View Single Post
08/24/20, 03:57 PM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,973
Check the LAM docu for the possible callback functions you could register, e.g.

Lua Code:
  1. local panelData = {
  2.         type                = 'panel',
  3.         name                = addonVars.addonNameMenu,
  4.         displayName         = addonVars.addonNameMenuDisplay,
  5.         author              = addonVars.addonAuthor,
  6.         version             = addonVars.addonVersionOptions,
  7.         registerForRefresh  = true,
  8.         registerForDefaults = true,
  9.         slashCommand        = "/myaddons",
  10.         website             = addonVars.website,
  11.         feedback            = addonVars.feedback,
  12.         donation            = addonVars.donation,
  13.     }
  14.     --The LibAddonMenu2.0 settings panel reference variable
  15.     myAddon.LAMPanel = LibAddonMenu2:RegisterAddonPanel(addonVars.gAddonName .. "_LAM", panelData)
  16.  
  17. local function MyLAMPanelCreated(panel)
  18.    --only if MY addon's LAM panel was created
  19.    if panel ~= myAddon.LAMPanel then return end
  20. end
  21.    
  22.    
  23.  
  24.     CALLBACK_MANAGER:RegisterCallback("LAM-PanelControlsCreated", MyLAMPanelCreated)
  25.     CALLBACK_MANAGER:RegisterCallback("LAM-RefreshPanel", MyLAMPanelRefreshed)
  26.     CALLBACK_MANAGER:RegisterCallback("LAM-PanelOpened", MyLAMPanelOpened)
  27.     CALLBACK_MANAGER:RegisterCallback("LAM-PanelClosed", MyLAMPanelClosed)

LAM-RefreshPanel will be called for each update of any of the controls in the panel!

Not sure if this is what you needed, else describe your usecase in detail/with an example please.
  Reply With Quote