Module wonderful.element.document
The Document class.
Classes and inheritance
Document | The document class. |
Class Document
Document:__new__(args) | Construct a new document. |
Document:switchFocus(reversed) | Switch focus to the next (or previous) element in the focusing context. |
Document:insertChild(element) | Set the child of the document. |
Document:removeChild() | Remove the child of the document. |
Classes and inheritance
- Document
-
The document class.
The root element of a render tree.
The document is a layout that has a single child. On composition, that child is provided with the whole area of the document. One would usually set another layout (e.g. a box) as the child to allow for the most flexibility.
Parent classes:
Class Document
- Document:__new__(args)
-
Construct a new document.
Parameters:
- args a keyword argument table
- display wonderful.display.Display a display
- args a keyword argument table
- Document:switchFocus(reversed)
-
Switch focus to the next (or previous) element in the focusing context.
Usually called by pressing
Tab
/Shift-Tab
.The focused element does not change if the events sent get canceled.
Parameters:
- reversed boolean if true, switches to the previous element
Returns:
-
boolean
whether the focus was actually switched
- Document:insertChild(element)
-
Set the child of the document.
Parameters:
- element the child element
Returns:
-
the previously set child
Or
-
`nil`
the document had no child
- Document:removeChild()
-
Remove the child of the document.
Returns:
-
the removed element
Or
-
`nil`
the docuemnt had no child