当前位置: 首页>>代码示例>>Python>>正文


Python HasTraits.edit_traits方法代码示例

本文整理汇总了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)
开发者ID:keflavich,项目名称:astropy-fitgui,代码行数:9,代码来源:fitgui.py

示例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)
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:30,代码来源:RegionInspector.py

示例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)
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:26,代码来源:NetworkInspector.py


注:本文中的enthought.traits.api.HasTraits.edit_traits方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。