Class el.Widget

A GUI Widget.

Is defined with el.object and can be inherrited. Objects must be instantiateed using object.new

Attributes

Widget.name Widget name (string).
Widget.x X position (readonly).
Widget.y Y position (readonly).
Widget.width Widget width (readonly).
Widget.height Widget height (readonly).
Widget.visible Widget visibility (bool).
Widget.opaque Widget is opaque (bool).

Methods

Widget:add (widget[, zorder]) Add a child widget.
Widget:elevate () Elevate this widget to toplevel status.
Widget:bounds () Returns the bounding box.
Widget:setBounds (x, y, w, h) Change the bounding box.
Widget:setBounds (bounds) Change the bounding box.
Widget:localBounds () Local bounding box.
Widget:right () Widget right edge.
Widget:bottom () Widget bottom edge (int).
Widget:screenX () Widget Screen X position (int).
Widget:screenY () Widget Screen Y position (int).
Widget:repaint () Repaint the entire widget.
Widget:repaint (b) Repaint a section.
Widget:repaint (x, y, w, h) Repaint section.
Widget:resize (w, h) Resize the widget.
Widget:toFront (focus) Bring to front.
Widget:toBack () To Back.

Class Methods

Widget.init () Initialize the widget.


Attributes

Widget.name
Widget name (string).
Widget.x
X position (readonly).
Widget.y
Y position (readonly).
Widget.width
Widget width (readonly).
Widget.height
Widget height (readonly).
Widget.visible
Widget visibility (bool). Shows or hides this Widget
Widget.opaque
Widget is opaque (bool). If set true you must fill the entire Widget background.

Methods

Widget:add (widget[, zorder])
Add a child widget.

Parameters:

  • widget el.Widget Widget to add
  • zorder integer Z-order (optional)
Widget:elevate ()
Elevate this widget to toplevel status.
Widget:bounds ()
Returns the bounding box.
Widget:setBounds (x, y, w, h)
Change the bounding box. The coords returned is relative to the top/left of the widget's parent.

Parameters:

  • x integer X pos
  • y integer Y pos
  • w integer Width
  • h integer Height
Widget:setBounds (bounds)
Change the bounding box. The coords returned is relative to the top/left of the widget's parent.

Parameters:

  • bounds mixed New bounds as a el.Bounds or table

Usage:

    -- Can also set a table. e.g.
    widget:setBounds ({
        x      = 0,
        y      = 0,
        width  = 100,
        height = 200
    })
Widget:localBounds ()
Local bounding box. Same as bounds with zero x and y coords
Widget:right ()
Widget right edge.
Widget:bottom ()
Widget bottom edge (int).
Widget:screenX ()
Widget Screen X position (int).
Widget:screenY ()
Widget Screen Y position (int).
Widget:repaint ()
Repaint the entire widget.
Widget:repaint (b)
Repaint a section.

Parameters:

Widget:repaint (x, y, w, h)
Repaint section.

Parameters:

  • x integer
  • y integer
  • w integer
  • h integer
Widget:resize (w, h)
Resize the widget.

Parameters:

  • w integer New width
  • h integer New height
Widget:toFront (focus)
Bring to front.

Parameters:

  • focus boolean If true, will also try to focus this widget.
Widget:toBack ()
To Back.

Class Methods

Widget.init ()
Initialize the widget. Override this to customize your widget. Required as an el.object
generated by LDoc 1.5.0 Last updated 2023-07-24 14:15:49