本文整理汇总了Python中efl.elementary.entry.Entry.editable方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.editable方法的具体用法?Python Entry.editable怎么用?Python Entry.editable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.editable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import editable [as 别名]
def __init__(self, parent, method):
Popup.__init__(self, parent)
self._method = method
self._param_entry = None
self._return_entry = None
# title
self.part_text_set('title,text', 'Method: %s()' % method.name)
self.show()
# content is vbox
vbox = Box(parent)
vbox.show()
self.content = vbox
# params label + entry
if len(method.params) > 0:
label = Label(parent)
label.size_hint_align = 0.0, 0.5
label.text = 'Params: ' + method.params_str
label.show()
vbox.pack_end(label)
en = Entry(parent)
self._param_entry = en
en.editable = True
en.scrollable = True
en.single_line = True
en.entry = ''
en.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
en.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
en.show()
vbox.pack_end(en)
sp = Separator(win)
sp.horizontal = True
sp.show()
vbox.pack_end(sp)
# returns label + entry
label = Label(parent)
label.size_hint_align = 0.0, 0.5
label.text = 'Returns: '
label.text += method.returns_str if method.returns_str else 'None'
label.show()
vbox.pack_end(label)
en = Entry(parent)
self._return_entry = en
en.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
en.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
en.editable = False
en.scrollable = True
en.disabled = True
en.single_line = True # TODO this is wrong, but the only way to show the entry :/
en.entry = '<br> <br> <br>'
en.show()
vbox.pack_end(en)
# pretty print check button
def pretty_output_clicked_cb(chk):
options.pretty_output = chk.state
ch = Check(parent)
ch.size_hint_align = 0.0, 0.5
ch.text = "Prettify output (loosing type infos)"
ch.state = options.pretty_output
ch.callback_changed_add(pretty_output_clicked_cb)
ch.show()
vbox.pack_end(ch)
# popup buttons
btn = Button(parent)
btn.text = 'Close'
btn.callback_clicked_add(lambda b: self.delete())
self.part_content_set('button1', btn)
btn = Button(parent)
btn.text = 'Clear output'
btn.callback_clicked_add(lambda b: self._return_entry.entry_set(''))
self.part_content_set('button2', btn)
btn = Button(parent)
btn.text = 'Run method'
btn.callback_clicked_add(self.run_clicked_cb)
self.part_content_set('button3', btn)