from traits.api import HasTraits, Str, Range, Enum
class Person(HasTraits):
name = Str('Jane Doe')
age = Range(low=0)
gender = Enum('female', 'male')
person = Person(age=30)
from traitsui.api import Item, RangeEditor, View
person_view = View(
Item('name'),
Item('gender'),
Item('age', editor=RangeEditor(mode='spinner', low=0, high=150)),
buttons=['OK', 'Cancel'],
resizable=True,
)
person.configure_traits(view=person_view)
Traceback (most recent call last):
File "F:\pythonProject1\lib\site-packages\IPython\core\interactiveshell.py", line 3369, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-7-2991deb889ce>", line 11, in <cell line: 11>
person.configure_traits(view=person_view)
File "F:\pythonProject1\lib\site-packages\traits\has_traits.py", line 2174, in configure_traits
rc = toolkit().view_application(
File "F:\pythonProject1\lib\site-packages\traitsui\toolkit.py", line 238, in view_application
raise NotImplementedError(
NotImplementedError: the 'null' toolkit does not implement this method
这个问题该怎么解决呢?