本文整理汇总了Python中efl.elementary.entry.Entry.callback_anchor_clicked_add方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.callback_anchor_clicked_add方法的具体用法?Python Entry.callback_anchor_clicked_add怎么用?Python Entry.callback_anchor_clicked_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.callback_anchor_clicked_add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: entry_clicked
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_anchor_clicked_add [as 别名]
def entry_clicked(obj, item=None):
win = StandardWindow("entry", "Entry", autodel=True)
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
en = Entry(win, line_wrap=False, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
en.entry_set("This is an entry widget in this window that<br>"
"uses markup <b>like this</> for styling and<br>"
"formatting <em>like this</>, as well as<br>"
"<a href=X><link>links in the text</></a>, so enter text<br>"
"in here to edit it. By the way, links are<br>"
"called <a href=anc-02>Anchors</a> so you will need<br>"
"to refer to them this way.")
en.callback_anchor_clicked_add(my_entry_anchor_test, en)
bx.pack_end(en)
en.show()
bx2 = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
bt = Button(win, text="Clear", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
bt.callback_clicked_add(my_entry_bt_1, en)
bx2.pack_end(bt)
bt.show()
bt = Button(win, text="Print", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
bt.callback_clicked_add(my_entry_bt_2, en)
bx2.pack_end(bt)
bt.show()
bt = Button(win, text="Selection", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
bt.callback_clicked_add(my_entry_bt_3, en)
bx2.pack_end(bt)
bt.show()
bt = Button(win, text="Insert", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
bt.callback_clicked_add(my_entry_bt_4, en)
bx2.pack_end(bt)
bt.show()
bx.pack_end(bx2)
bx2.show()
en.focus_set(True)
win.show()
示例2: entry_anchor_clicked
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_anchor_clicked_add [as 别名]
def entry_anchor_clicked(obj, item=None):
win = StandardWindow("entry", "Entry Anchor", autodel=True, size=(400,400))
box = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(box)
entry = Entry(win, anchor_hover_style="popout", anchor_hover_parent=win)
entry.text = "<a href=url:http://www.enlightenment.org/>Enlightenment</a>"
entry.callback_anchor_clicked_add(anchor_clicked)
entry.callback_anchor_hover_opened_add(anchor_hover_opened)
entry.show()
frame = Frame(win, size_hint_align=FILL_BOTH, text="Entry test",
content=entry)
frame.show()
box.pack_end(frame)
box.show()
win.show()
示例3: AboutWin
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_anchor_clicked_add [as 别名]
class AboutWin(DialogWindow):
def __init__(self, parent):
DialogWindow.__init__(self, parent, 'egitu-info', 'Egitu',
autodel=True)
fr = Frame(self, style='pad_large', size_hint_expand=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
hbox = Box(self, horizontal=True, padding=(12,12))
fr.content = hbox
hbox.show()
vbox = Box(self, align=(0.0,0.0), padding=(6,6),
size_hint_expand=EXPAND_VERT, size_hint_fill=FILL_VERT)
hbox.pack_end(vbox)
vbox.show()
# icon + version
ic = SafeIcon(self, 'egitu', size_hint_min=(64,64))
vbox.pack_end(ic)
ic.show()
lb = Label(self, text='Version: %s' % __version__)
vbox.pack_end(lb)
lb.show()
sep = Separator(self, horizontal=True)
vbox.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text='Egitu', size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(INFO))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text='Website',size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: xdg_open(HOMEPAGE))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text='Authors', size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(AUTHORS))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text='License', size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(LICENSE))
vbox.pack_end(bt)
bt.show()
# main text
self.entry = Entry(self, editable=False, scrollable=True, text=INFO,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
self.entry.callback_anchor_clicked_add(lambda e,i: xdg_open(i.name))
hbox.pack_end(self.entry)
self.entry.show()
self.resize(400, 200)
self.show()
示例4: AboutWindow
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_anchor_clicked_add [as 别名]
class AboutWindow(Window):
__initialized = False
def __init__(self, parent, title="About", standardicon="dialog-information", \
version="N/A", authors="No One", \
licen="GPL", webaddress="", info="Something, something, turtles"):
if AboutWindow.__initialized:
raise InstanceError("You can't create more than 1 instance of AboutWindow")
AboutWindow.__initialized = True
Window.__init__(self, title, ELM_WIN_DIALOG_BASIC, autodel=True)
self.callback_delete_request_add(self.close_inst)
background = Background(self, size_hint_weight=EXPAND_BOTH)
self.resize_object_add(background)
background.show()
fr = Frame(self, style='pad_large', size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
hbox = Box(self, horizontal=True, padding=(12,12))
fr.content = hbox
hbox.show()
vbox = Box(self, align=(0.0,0.0), padding=(6,6),
size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT)
hbox.pack_end(vbox)
vbox.show()
# icon + version
ic = Icon(self, size_hint_min=(64,64))
ic.standard_set(standardicon)
vbox.pack_end(ic)
ic.show()
lb = Label(self, text=('Version: %s') % version)
vbox.pack_end(lb)
lb.show()
sep = Separator(self, horizontal=True)
vbox.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text=(title), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(info))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=('Website'),size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: xdg_open(webaddress))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=('Authors'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(authors))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=('License'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(licen))
vbox.pack_end(bt)
bt.show()
# main text
self.entry = Entry(self, editable=False, scrollable=True, text=info,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.entry.callback_anchor_clicked_add(lambda e,i: xdg_open(i.name))
hbox.pack_end(self.entry)
self.entry.show()
self.resize(400, 200)
self.show()
def close_inst(self, obj):
AboutWindow.__initialized = False
示例5: InfoWin
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_anchor_clicked_add [as 别名]
class InfoWin(DialogWindow):
def __init__(self, parent):
DialogWindow.__init__(self, parent, 'epack-info', 'Epack', autodel=True)
fr = Frame(self, style='pad_large', size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
hbox = Box(self, horizontal=True, padding=(12,12))
fr.content = hbox
hbox.show()
vbox = Box(self, align=(0.0,0.0), padding=(6,6),
size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT)
hbox.pack_end(vbox)
vbox.show()
# icon + version
ic = Icon(self, standard='epack', size_hint_min=(64,64))
vbox.pack_end(ic)
ic.show()
lb = Label(self, text=_('Version: %s') % __version__)
vbox.pack_end(lb)
lb.show()
sep = Separator(self, horizontal=True)
vbox.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text=_('Epack'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.INFO))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('Website'),size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: utils.xdg_open(utils.GITHUB))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('Authors'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.AUTHORS))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('License'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.LICENSE))
vbox.pack_end(bt)
bt.show()
# main text
self.entry = Entry(self, editable=False, scrollable=True, text=utils.INFO,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.entry.callback_anchor_clicked_add(lambda e,i: utils.xdg_open(i.name))
hbox.pack_end(self.entry)
self.entry.show()
self.resize(400, 200)
self.show()