mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
402 B
Lua
21 lines
402 B
Lua
13 years ago
|
--[[
|
||
|
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.
|
||
|
]]
|
||
|
Event = {}
|
||
|
|
||
|
function Event:new(name, ...)
|
||
|
local o = {
|
||
|
handler = "on"..name,
|
||
|
args = {...}
|
||
|
}
|
||
|
setmetatable(o, self)
|
||
|
self.__index = self
|
||
|
return o
|
||
|
end
|