Thread: kgPanels Button
View Single Post
10-14-14, 10:10 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Rather than setting that global "OtherPanel" in the second panel's OnLoad script, you should just use the method kgPanels provides for accessing other panels:

Code:
function self:OnClick()
    ToggleAllBags() -- Call the local reference to ToggleAllBags
    local OtherPanel = kgPanels:FetchFrame("Name of the second panel")
    OtherPanel:SetShown(not OtherPanel:IsShown())
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote