Module wonderful.widget
The Widget class.
Classes and inheritance
wonderful.widget.Widget | The base widget class. |
Class Widget
Widget.focusable | |
Widget:__new__(args) | Construct a new widget instance. |
Widget:_render(fbView) | An abstract method to render the widget. |
Widget:requestRender(_quiet) | Flag the element to render it the next time Wonderful:render is called. |
Widget:flush(fbView) | Check whether render is requested, and call _render if it is. |
Widget:isFocused(_element) | Check whether the element is focused. |
Classes and inheritance
- wonderful.widget.Widget
-
The base widget class.
A widget is an element that can be rendered. It also acts as a relative layout, allowing to add children at fixed relative position.
Parent classes:
-
wonderful.layout.relative.RelativeLayout
Class Widget
- Widget.focusable
- Widget:__new__(args)
-
Construct a new widget instance.
Parameters:
- args
- Widget:_render(fbView)
-
An abstract method to render the widget.
If you're making your own widget, provide an implementation for this method.
Calling this method forcefully redraws the widget, which is discouraged. Consider using requestRender instead.
Parameters:
- fbView wonderful.buffer.BufferView a view on the framebuffer
See also:
- Widget:requestRender(_quiet)
-
Flag the element to render it the next time
Wonderful:render
is called.Parameters:
- _quiet
- Widget:flush(fbView)
-
Check whether render is requested, and call _render if it is. Do
nothing otherwise.
Parameters:
- fbView wonderful.buffer.BufferView a view on the framebuffer
Returns:
-
boolean
whether the element was actually rendered
See also:
- Widget:isFocused(_element)
-
Check whether the element is focused.
Parameters:
- _element
Returns:
-
boolean