2
0
mirror of https://github.com/koreader/koreader synced 2024-11-11 19:11:14 +00:00
koreader/frontend/ui/event.lua
2014-03-13 21:52:43 +08:00

23 lines
449 B
Lua

--[[
Events are messages that are passed through the widget tree
Events need a "name" attribute as minimal data.
In order to see how event propagation works and how to make
widgets event-aware see the implementation in WidgetContainer
below.
]]
local Event = {}
function Event:new(name, ...)
local o = {
handler = "on"..name,
args = {...}
}
setmetatable(o, self)
self.__index = self
return o
end
return Event