[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: _G function inside table
- From: Kev Lugli <kevlugli@...>
- Date: Sun, 26 Jun 2011 21:31:03 -0300
SORRY FOR THE DUPLICATE, I FORGOT TO CHANGE THE SUBJECT.
Thanks! You've been very helpful. Now, I'd like to know how to do the
same, but with a colon operator. The thing is that I'm doing a working
days calendar's script with lua and IUP, and I want to automate the
creation of days. The piece of code is this:
-------------------------------Begin Of Code---------------------------------
function addnewday(name)
_G['chk'..name] = iup.toggle {title = name}
_G['txtFrom'..name] = iup.text {spin = 'yes', active = 'no', size =
'40', spinmax = '24', spinmin = '1', spinvalue = '12' }
_G['txtTo'..name] = iup.text {spin = 'yes', active = 'no', size =
'40', spinmax = '24', spinmin = '1', spinvalue = '12' }
_G['frm'..name] = iup.frame {
iup.vbox {
_G['chk'..name],
iup.hbox{iup.label {title = 'From'}, _G['txtFrom'..name]},
iup.hbox{iup.label {title = To'}, _G['txtTo'..name]}
}
}
table.insert(listOfDays, _G['frm'..name])
_G['chk'..name..':action']= function (a)
print ('a')
_G['txtFrom'..name..'.active'] = 'yes'
_G['txtTo'..name..'.active'] = 'yes'
end
end
addnewday('Monday')
addnewday('Tuesday')
addnewday('Wednesday')
addnewday('Thursday')
addnewday('Friday')
addnewday('Saturday')
addnewday('Sunday')
-------------------------------End Of Code---------------------------------
The function " 'chk'..name..':action' " is never called whenever I
check any of the toggle controls, so I think it' s a problem with the
name of it.