Module wonderful
The main module, which exports the Wonderful class.
You need an instance of this class in order to run a GUI. It allows you to create documents (which you're not supposed to create any other way unless you're casting some pitch-black magic).
It's also responsible for catching events (such as touches or key presses) when running the event loop.
Classes and inheritance
Wonderful | The main class of the library. |
Class Wonderful
Wonderful:__new__([args]) | Construct a new instance. |
Wonderful:updateKeyboards() | Update the keyboard bind mappings. |
Wonderful:addDocument(args) | Create a new instance of wonderful.element.document.Document. |
Wonderful:render(noFlush, force) | Render the documents. |
Wonderful:compose() | Compose all documents. |
Wonderful:hit(screen, x, y) | Trace a "hit": find an element by touch coordinates. |
Wonderful:addSignal(name, cls) | Add a new signal to dispatch. |
Wonderful:run(inThread) | Run the event loop. |
Wonderful:runThreaded() | Create an event loop thread, and start the loop. |
Wonderful:stop() | Stop the event loop. |
Wonderful:__destroy__() | Destroy an instance of the main class. |
Classes and inheritance
Class Wonderful
- Wonderful:__new__([args])
-
Construct a new instance.
The debug mode introduces a few checks that allow to catch bugs and errors. It may slow down the program significantly, though.
Parameters:
- args a keyword arguments table
- debug boolean whether the debug mode should be set (optional)
- args a keyword arguments table
- Wonderful:updateKeyboards()
- Update the keyboard bind mappings.
- Wonderful:addDocument(args)
-
Create a new instance of wonderful.element.document.Document.
Parameters:
- args a keyword argument table
- x int a column number of the document region's top-left cell (optional)
- y int a row number of the document region's top-left cell (optional)
- w int a width of the document region (optional)
- h int a height of the document region (optional)
- screen string a screen address (optional)
Returns:
-
wonderful.element.document.Document
the document instance
See also:
- args a keyword argument table
- Wonderful:render(noFlush, force)
-
Render the documents.
Parameters:
- noFlush
- force
- Wonderful:compose()
- Compose all documents.
- Wonderful:hit(screen, x, y)
-
Trace a "hit": find an element by touch coordinates.
Parameters:
- screen string a screen address
- x number a column number
- y number a row number
Returns:
-
an element
- Wonderful:addSignal(name, cls)
-
Add a new signal to dispatch.
Parameters:
- name string a signal name
- cls a wonderful.std.event.signal.Signal class
- Wonderful:run(inThread)
-
Run the event loop.
Parameters:
- inThread
- Wonderful:runThreaded()
-
Create an event loop thread, and start the loop.
Requires the
thread
library, available in OpenOS 1.6.4 and higher.Returns:
-
the thread handle
- Wonderful:stop()
- Stop the event loop.
- Wonderful:__destroy__()
- Destroy an instance of the main class. Runs restore, and cleans up.