Quote:
Originally Posted by Carmelocotonto
Thanks Pazos, but I don't understand "event" concept and how is its implementation. I don't know LUA. I have tried looking some LUA's files to use the same ideas, but I don't understand the concept. Can you tell me an example of event that is handled by the reader footer. Then I will try something similar.
|
functions that are part of an object and start with "on" are normally events, like
https://github.com/koreader/koreader...ua#L1819-L1867
Instead of having to remember an instance of the object and its name to call the function you broadcast the event and each widget that can handle the event will react accordly to the event you broadcasted.
Have a look at
https://github.com/koreader/koreader...broadcastEvent.
For a function called "onDoFoo" you broadcast a new event "DoFoo", and the event is delivered to all widgets and handled by widgets that implemented "onDoFoo"