如何在TraisUI中指定VSplit或HSplit的拆分比率?

2024-10-03 23:23:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我的观点定义如下

DefaultView = View(
    HSplit(
        Item("figure", editor=MPLFigureEditor(toolbar=True),
             show_label=False),
        VGroup(
            Item("draw_button", show_label=False)),
        show_labels=False
    ),
    width=800, height=600, title="Facial Triangles", resizable=True)

我查阅了HSplit的官方文档,发现没有任何属性或方法来指定初始分割比率。你知道吗

是否有一种方法来指定初始分割比率?你知道吗


Tags: 方法viewfalsetrue定义showitemlabel
1条回答
网友
1楼 · 发布于 2024-10-03 23:23:39

this discussion,我得到了方法:通过指定widthheight属性的Item。例如,我的上述视图已更新:

DefaultView = View(
    HSplit(
        Item("figure", editor=MPLFigureEditor(toolbar=True), width=0.95,
             show_label=False),
        VGroup(
            Item("draw_button", show_label=False)),
        show_labels=False
    ),
    width=800, height=600, title="Facial Triangles", resizable=True)

相关问题 更多 >