我的 View 定义如下
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的官方文档发现没有属性或方法来指定初始分流比。
有没有办法指定初始分流比?
最佳答案
来自this discussion ,我已经得到了方法:通过指定 Item
的 width
或 height
属性。例如,我上面的 View 已更新:
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)
关于python - 如何在 TraisUI 中指定 VSplit 和 HSplit 的分割比例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42899365/