本文整理汇总了Python中muntjac.api.Label.setImmediate方法的典型用法代码示例。如果您正苦于以下问题:Python Label.setImmediate方法的具体用法?Python Label.setImmediate怎么用?Python Label.setImmediate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类muntjac.api.Label
的用法示例。
在下文中一共展示了Label.setImmediate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ReadonlyEditor
# 需要导入模块: from muntjac.api import Label [as 别名]
# 或者: from muntjac.api.Label import setImmediate [as 别名]
class ReadonlyEditor ( Editor ):
""" Base class for read-only style editors, which displays a read-only text
field, containing a text representation of the object trait value.
"""
#---------------------------------------------------------------------------
# Finishes initializing the editor by creating the underlying toolkit
# widget:
#---------------------------------------------------------------------------
def init ( self, parent ):
""" Finishes initializing the editor by creating the underlying toolkit
widget.
"""
self.control = Label()
self.control.setImmediate(True)
self.control.setValue( str(self.str_value) )
# if self.item.resizable is True or self.item.height != -1.0:
# self.control.setSizePolicy(QtGui.QSizePolicy.Expanding,
# QtGui.QSizePolicy.Expanding)
# self.control.setWordWrap(True)
self.set_tooltip()
#---------------------------------------------------------------------------
# Updates the editor when the object trait changes external to the editor:
#---------------------------------------------------------------------------
def update_editor ( self ):
""" Updates the editor when the object trait changes externally to the
editor.
"""
self.control.setValue( str(self.str_value) )