mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
19 lines
338 B
Lua
19 lines
338 B
Lua
--[[--
|
|
A check box.
|
|
|
|
@widget check
|
|
--]]--
|
|
|
|
return function (self)
|
|
self:onPress(function ()
|
|
self.value = not self.value
|
|
end)
|
|
|
|
self:onChange(function ()
|
|
local subtype = self.value and 'check.checked' or 'check.unchecked'
|
|
self.type = { 'check', subtype }
|
|
end)
|
|
|
|
self.value = not not self.value
|
|
end
|