'Creates an :obj:`.OWToolbar` with the specified ``text``, ``orientation`` and ``buttons`` and adds it to ``widget``.
.. seealso:: :obj:`.OWToolbar`'

def toolbar(self, widget, text, orientation, buttons, nomargin=False):

    t = OWToolbar(self, text, orientation, buttons, widget, nomargin)
    if nomargin:
        t.layout().setContentsMargins(0, 0, 0, 0)
    if (widget.layout() is not None):
        widget.layout().addWidget(t)
    return t
