Thread: kgPanels Button
View Single Post
10-14-14, 11:52 AM   #4
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Originally Posted by Phanx View Post
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
Indeed, that's a nicer solution. I forgot kgPanels had that.
  Reply With Quote