Is there a more elegant way to set this boolean value?
SetScript() is a game API, while "OnClick" is its handler. What is important is the method that triggers when I click on the checkbutton.
local foo = true
checkbutton:SetScript("OnClick", function()
if foo == true then foo = false
else foo = true
end
end)