View定义界面
使用View来自定义界面
class ModelManager(HasTraits):
model_name =
Str
category =
Str
model_file =
Str
model_number =
Int
view =
View(
Item("model_name", label=u"模型名称"), #将Traits属性和Item关联起来,分别定义标签,中文需要使用u
Item("model_file", label=u"文件名"),
Item("category", label=u"模型类型"),
Item("model_number", label=u"模型数量"),
title=u
"模型资料",
width=
220,
resizable=
True
)
model =
ModelManager()
model.configure_traits()
转载于:https://www.cnblogs.com/ssyfj/p/9309269.html
相关资源:Python科学计算
转载请注明原文地址: https://win8.8miu.com/read-7301.html