本文整理汇总了Python中enthought.traits.api.HasTraits.edit_traits方法的典型用法代码示例。如果您正苦于以下问题:Python HasTraits.edit_traits方法的具体用法?Python HasTraits.edit_traits怎么用?Python HasTraits.edit_traits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enthought.traits.api.HasTraits
的用法示例。
在下文中一共展示了HasTraits.edit_traits方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _showerror_fired
# 需要导入模块: from enthought.traits.api import HasTraits [as 别名]
# 或者: from enthought.traits.api.HasTraits import edit_traits [as 别名]
def _showerror_fired(self,evt):
if self.tmodel.lastfitfailure:
ex = self.tmodel.lastfitfailure
dialog = HasTraits(s=ex.__class__.__name__+': '+str(ex))
view = View(Item('s',style='custom',show_label=False),
resizable=True,buttons=['OK'],title='Fitting error message')
dialog.edit_traits(view=view)
示例2: edit_traits
# 需要导入模块: from enthought.traits.api import HasTraits [as 别名]
# 或者: from enthought.traits.api.HasTraits import edit_traits [as 别名]
def edit_traits(self, *args, **kwargs):
"""Extend to set up the view and bind key events."""
if self.parent:
# Allow the inspector to handle key events
self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)
self.parent.SetFocusFromKbd()
# Set the view to the traits_view attribute if it is not specified
# Necessary because traits_view is created as an instance attribute
# at runtime, rather than as part of the class definition
if not kwargs.get('view', None):
kwargs['view'] = self.traits_view
# Set handler and buttons if they are not specified
if not kwargs['view'].handler:
kwargs['view'].handler = RegionInspectorHandler
if not kwargs['view'].buttons:
kwargs['view'].buttons = NoButtons
if self.parent:
# Inspector is being embedded - don't show the title
self.traits_view.title = ""
#if 'level1' in self.region.getName():
# from dbgp.client import brk; brk(port=9011)
return HasTraits.edit_traits(self, *args, **kwargs)
示例3: edit_traits
# 需要导入模块: from enthought.traits.api import HasTraits [as 别名]
# 或者: from enthought.traits.api.HasTraits import edit_traits [as 别名]
def edit_traits(self, *args, **kwargs):
"""Extend to set the current view."""
if self.parent:
# Allow the inspector to handle key events
self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)
# Set the view to the traits_view attribute if it is not specified
# Necessary because traits_view is created as an instance attribute
# at runtime, rather than as part of the class definition
if not kwargs.get('view', None):
kwargs['view'] = self.traits_view
# Set handler and buttons if they are not specified
if not kwargs['view'].handler:
kwargs['view'].handler = NetworkInspectorHandler
if not kwargs['view'].buttons:
kwargs['view'].buttons = NoButtons
# Remove the title if the inspector is being embedded
if self.parent:
self.traits_view.title = ""
return HasTraits.edit_traits(self, *args, **kwargs)