如何设置 enaml window 的背景颜色?

How to set the background color of an enaml window?

我正在尝试使用 enaml 为我的应用程序创建视图。我想知道如何设置 Window 小部件的背景颜色。我看到我可以使用样式表为 window 中的内容设置颜色,但我似乎无法找到设置 window.

颜色的方法
enamldef Main(MainWindow):
StyleSheet:
    Style:
        element = 'PushButton'

        Setter:
            field = 'background'
            value = 'indianred'

title << ""
initial_size = (1000,500)
initial_position = (300,150)
icon = loadIcon(normpath('TitleIcon.png'))
visible = True
always_on_top = True
style_class << "WindowStyle"

MyMenuBar:
    pass

Container:
    #constraints = [vbox(label, label, spacing=0)]
    PushButton:
        text = "one"
    pass

您只需为正确的元素设置样式:

enamldef Main(MainWindow):
    StyleSheet:
        Style:
            element = 'Main'
            Setter:
                field = 'background'
                value = 'indianred'
    Container:
        PushButton:
            text = "one"