doc: improve doc for creating new widget

This commit is contained in:
getzze 2017-03-31 23:55:25 +01:00 committed by Daniel Hahler
parent a87387d9f3
commit 0e9a0cdee9
1 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Creating new widget
All widgets have to be generated via this function so that
the needed signals are added and mouse input handling is set up.
All widgets have to be generated by the `wibox.widget.base.make_widget` function
so that the needed signals are added and mouse input handling is set up.
The returned widget will have a `:buttons` member function that can be used to
register a set of mouse button events with the widget.
@ -111,3 +111,8 @@ looks like this:
widget:after_draw_child(context, cr, child_index, child, width, height)
end
widget:after_draw_children(context, cr, width, height)
The `:set_children()` method is called recursively when setting a widget with
the declarative layout system, therefore the method should be well defined.
It should probably hook to the `:add` or `:add_widget` methods or be overridden
to do nothing.