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 (subclass) Use this method to define a widget subclass that's inherited from a base class widget.
Widget:new (o) Use this method to initiate an instance of a class.
Widget:paintTo (bb, x, y) Paint widget to a BlitBuffer.

Tables

Widget Widget base class


Functions

Widget:extend (subclass)
Use this method to define a widget subclass that's inherited from a base class widget. It only setups the metatable (or prototype chain) and will not initiate a real instance, i.e. call self:init().

Parameters:

Returns:

    Widget
Widget:new (o)
Use this method to initiate an instance of a class. Do NOT use it for class definitions because it also calls self:init().

Parameters:

Returns:

    Widget
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 integer x offset within the BlitBuffer
  • y integer y offset within the BlitBuffer

Tables

Widget
Widget base class
generated by LDoc 1.5.0 Last updated 2024-04-24 16:32:09