Thread: Check boxes
View Single Post
03-20-06, 04:26 PM   #2
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
Post

There are these functions you can use:
Code:
state = checkbox:GetChecked()
checkbox:SetChecked(state)
to handle the state of the checkbox.

You could use the OnClick script of the checkbox to update your saved variable, and just reference your saved variable within the code.
Code:
<OnClick>dead_SV.Enabled = MyFormHRFChkOndeath:GetChecked();</OnClick>
...
if(event == "PLAYER_DEAD" and deadpc == playerid and dead_SV.Enabled) then
	...
elseif(event == "VARIABLES_LOADED") then
	if(dead_SV == nil) then dead_SV = {}; end
	if(dead_SV.Enabled == nil) then dead_SV.Enabled = true; end
	MyFormHRFChkOndeath:SetChecked(dead_SV.Enabled);
end
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote