Check the LAM docu for the possible callback functions you could register, e.g.
Lua Code:
local panelData = {
type = 'panel',
name = addonVars.addonNameMenu,
displayName = addonVars.addonNameMenuDisplay,
author = addonVars.addonAuthor,
version = addonVars.addonVersionOptions,
registerForRefresh = true,
registerForDefaults = true,
slashCommand = "/myaddons",
website = addonVars.website,
feedback = addonVars.feedback,
donation = addonVars.donation,
}
--The LibAddonMenu2.0 settings panel reference variable
myAddon.LAMPanel = LibAddonMenu2:RegisterAddonPanel(addonVars.gAddonName .. "_LAM", panelData)
local function MyLAMPanelCreated(panel)
--only if MY addon's LAM panel was created
if panel ~= myAddon.LAMPanel then return end
end
CALLBACK_MANAGER:RegisterCallback("LAM-PanelControlsCreated", MyLAMPanelCreated)
CALLBACK_MANAGER:RegisterCallback("LAM-RefreshPanel", MyLAMPanelRefreshed)
CALLBACK_MANAGER:RegisterCallback("LAM-PanelOpened", MyLAMPanelOpened)
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.