有没有办法在 traitsui 视图中引用字典中的项目?
换句话说,有没有办法使用 Dict 特征来完成我的意思:
from traits.api import *
from traitsui.api import *
from traitsui.ui_editors.array_view_editor import ArrayViewEditor
import numpy as np
class SmallPartOfLargeApplication(HasTraits):
a=Dict
def _a_default(self):
return {'a_stat':np.random.random((10,1)),
'b_stat':np.random.random((10,10))}
traits_view=View(
Item('a.a_stat',editor=ArrayViewEditor()))
SmallPartOfLargeApplication().configure_traits()