Module widget

awesome widget API

Author:

Julien Danjou <julien@danjou.info>

Copyright© 2008-2009 Julien Danjou

Functions

add_signal (name, func) Add a signal.
buttons (buttons_table) Set the widget buttons.
emit_signal (name, ...) Emit a signal.
extents () Get the widget extents, i.e., the size the widgets needs to be drawn.
remove_signal (name, func) Remove a signal.

Tables

imagebox Imagebox widget.
systray Systray widget.
textbox Textbox widgets.
widget Generic widget.


Functions

add_signal (name, func)
Add a signal.

Parameters

  • name: A signal name.
  • func: A function to call when the signal is emitted.
buttons (buttons_table)
Set the widget buttons. It will receive a press or release event when of this buttons is pressed.

Parameters

  • buttons_table: A table with buttons, or nil if you do not want to modify it.

Return value:

A table with buttons the widget is listening to.
emit_signal (name, ...)
Emit a signal.

Parameters

  • name: A signal name.
  • ...: Various arguments, optional.
extents ()
Get the widget extents, i.e., the size the widgets needs to be drawn.

Return value:

A table with x, y, width and height.
remove_signal (name, func)
Remove a signal.

Parameters

  • name: A signal name.
  • func: A function to remove.

Tables

imagebox
Imagebox widget.

Fields

  • image: The image to display.
  • bg: The background color to use.
systray
Systray widget.
textbox
Textbox widgets.

Fields

  • text: The text to display.
  • width: The width of the textbox. Set to 0 for auto.
  • wrap: The wrap mode: word, char, word_char.
  • ellipsize: The ellipsize mode: start, middle or end.
  • border_width: The border width to draw around.
  • border_color: The border color.
  • align: Text alignment, left, center or right.
  • margin: Method to pass text margin: a table with top, left, right and bottom keys.
  • bg: Background color.
  • bg_image: Background image.
  • bg_align: Background image alignment, left, center, right, bottom, top or middle
  • bg_resize: Background resize.
widget
Generic widget.

Fields

  • visible: The widget visibility.
  • type: The widget type. Can only be set using constructor. Type can be either textbox, imagebox or systray.

Valid XHTML 1.0!