Reply
Thread Tools Display Modes
Unread 11-03-05, 09:29 AM   #1
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
CheckButton & Initialize Function......

once i wrote the code based on a thought

when CheckButton got checked, its value is 1
when it's uncheck . its value is 0



but i was wrong....when it's uncheck....its value is NIL......

so my Initialize Function should sth like this

Code:
UserSet = {}
function MyUI_Initialize()

        if UserSet=nil then 
             ---- new user-----
        else
             ----- previous user -----
        end
end

and it's begin.......

when my default is set alll status ON

and user goes to Config Window and set all CheckButton Unchecked.....

next time when he is back.....

UserSet = nil...... ('cos all his Child is nil.....)

and he goes to Default Settings.........................

Hmmm,,,, how can I handle this.....



or....maybe I was totally wrong.....

maybe..the table is still there

with nothing but UserSet = {} .................



how i loved checked buttons.....
xmlover is offline   Reply With Quote
Unread 11-03-05, 12:45 PM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 575
Well, you'd do something like

yourConfig.configValue = ButtonName:GetChecked() or false;
Iriel is offline   Reply With Quote
Unread 11-03-05, 11:55 PM   #3
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
Originally Posted by Iriel
Well, you'd do something like

yourConfig.configValue = ButtonName:GetChecked() or false;

wow....is this means that a nil value won't return to yourConfig.configValue ?

and

Code:
yourConfig.configValue = ButtonName:GetChecked() or 0;
is it OK?
so ButtonName:SetChecked() can use this yourConfig.configValue without a IF
xmlover is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » CheckButton & Initialize Function......

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off