Module ui.widget.widget
This is a generic Widget interface, which is the base class for all other widgets.
Widgets can be queried about their size and can be painted on screen. that's it for now. Probably we need something more elaborate later.
If the table that was given to us as parameter has an "init" method, it will be called. use this to set instance variables rather than class variables.
Functions
Widget:extend (baseclass) | Use this method to define a subclass widget class that's inherited from a base class widget. |
Widget:new (o) | Use this method to initiatie a instance of a class, don't use it for class definition because it also calls self:init(). |
Widget:paintTo (bb, x, y) | Paint widget to a BlitBuffer. |
Tables
Widget | Widget base class |
Functions
- Widget:extend (baseclass)
-
Use this method to define a subclass widget class that's inherited from a
base class widget. It only setups the metabale (or prototype chain) and will
not initiate a real instance, i.e. call self:init().
Parameters:
- baseclass Widget
Returns:
- Widget:new (o)
-
Use this method to initiatie a instance of a class, don't use it for class
definition because it also calls self:init().
Parameters:
- o Widget
Returns:
- Widget:paintTo (bb, x, y)
-
Paint widget to a BlitBuffer.
Parameters:
- bb BlitBuffer BlitBuffer to paint to. If it's the screen BlitBuffer, then widget will show up on screen refresh.
- x int x offset within the BlitBuffer
- y int y offset within the BlitBuffer