本文整理汇总了Python中efl.elementary.entry.Entry.entry_insert方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.entry_insert方法的具体用法?Python Entry.entry_insert怎么用?Python Entry.entry_insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.entry_insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CommandOutputEntry
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import entry_insert [as 别名]
class CommandOutputEntry(Table):
def __init__(self, parent, min_size=(0,0)):
Table.__init__(self, parent, size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self._entry = Entry(self, scrollable=True, editable=False,
line_wrap=ELM_WRAP_NONE,
size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self._wheel = Progressbar(self, style='wheel', pulse_mode=True,
size_hint_expand=EXPAND_BOTH)
self._rect = Rectangle(self.evas, size_hint_min=min_size,
size_hint_expand=EXPAND_BOTH, color=(0,0,0,0))
self.pack(self._entry, 0, 0, 1, 1)
self.pack(self._rect, 0, 0, 1, 1)
self.pack(self._wheel, 0, 0, 1, 1)
self._last_was_carriage = False
self._entry.show()
self._rect.show()
self.show()
@property
def text(self):
return self._entry.text
@text.setter
def text(self, text):
self._entry.text = text
def pulse_start(self):
self._rect.repeat_events = False
self._wheel.pulse(True)
self._wheel.show()
def pulse_stop(self):
self._rect.repeat_events = True
self._wheel.pulse(False)
self._wheel.hide()
def successfull(self):
self._entry.entry_append('<success>Operation successfully completed.</success><br>')
def failure(self):
self._entry.entry_append('<failure>Error! Something goes wrong.</failure><br>')
def error_set(self, text):
self._entry.text = '<failure>Error:</failure><br>%s' % text
def append_raw(self, line, sep=None):
if self._last_was_carriage is True:
self._entry.cursor_selection_begin()
self._entry.cursor_line_end_set()
self._entry.cursor_selection_end()
self._entry.entry_insert('')
if sep == '\n':
self._entry.entry_append(line + '<br>')
self._entry.cursor_end_set()
self._last_was_carriage = False
elif sep == '\r':
self._entry.entry_append(line)
self._last_was_carriage = True
else:
self._entry.entry_append(line)
self._last_was_carriage = False