Python ENML:允许窗口可调整大小

Python ENML:允许窗口可调整大小,python,enaml,Python,Enaml,如果我使用窗口小部件,它的大小不可调整,并且固定为其容器大小。怎么 我可以将窗口设置为可调整大小吗?以下内容不可调整大小: enamldef MyWindow(Window) VGroup: MPLCanvas: figure = Figure() CheckBox: text = "Show current" CheckBox: text = "Show mean"

如果我使用窗口小部件,它的大小不可调整,并且固定为其容器大小。怎么 我可以将窗口设置为可调整大小吗?以下内容不可调整大小:

enamldef MyWindow(Window)
    VGroup: 
        MPLCanvas:
            figure = Figure()
        CheckBox:
            text = "Show current"
        CheckBox:
            text = "Show mean"
        CheckBox:
            text = "Show first detector"

这对我很有用,我可以在两个方向上扩展窗口。如果您的意思是无法缩小窗口,这是因为它受到matplotlib图形大小的限制。如果要强制图形缩小到自然大小以下,则必须使用约束明确处理:

enamldef Main(Window):
    VGroup:
        MPLCanvas:
            figure = Figure()
            resist_width = 'ignore'
            resist_height = 'ignore'
            constraints = [width >= 100, height >= 100]
        CheckBox:
            text = "Show current"
        CheckBox:
            text = "Show mean"
        CheckBox:
            text = "Show first detector"