コード例 #1
0
ファイル: uiHelpers.py プロジェクト: FreakTheMighty/pyjamas
def colour(contents, colour):
    """ Add colour to the given contents.

        'contents' is a widget or panel to colour, and 'colour' is the HTML
        colour code (eg, "#808080", etc) to use for the background colour.

        We returned the given contents wrapped in a Panel which has the given
        background colour attached.
    """
    wrapper = VerticalPanel()
    wrapper.add(contents)
    DOM.setStyleAttribute(wrapper.getElement(), "background-color", colour)
    return wrapper
コード例 #2
0
ファイル: uiHelpers.py プロジェクト: ygyangguang/pyjs
def colour(contents, colour):
    """ Add colour to the given contents.

        'contents' is a widget or panel to colour, and 'colour' is the HTML
        colour code (eg, "#808080", etc) to use for the background colour.

        We returned the given contents wrapped in a Panel which has the given
        background colour attached.
    """
    wrapper = VerticalPanel()
    wrapper.add(contents)
    DOM.setStyleAttribute(wrapper.getElement(), "background-color", colour)
    return wrapper