本文整理汇总了Python中efl.elementary.button.Button类的典型用法代码示例。如果您正苦于以下问题:Python Button类的具体用法?Python Button怎么用?Python Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Button类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: menu_create
def menu_create(search, win):
tbx.clear()
for category in items:
frame = Frame(win, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH, text=category[0])
frame.show()
tbx.pack_end(frame)
tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
size_hint_align=(EVAS_HINT_FILL, 0.0))
frame.content_set(tbx2)
tbx2.show()
cnt = 0
for test in category[1]:
if (search == None) or (test[0].lower().find(search.lower()) > -1):
bt = Button(win, text=test[0])
bt.callback_clicked_add(selected_cb, test[1], test[2])
bt.show()
tbx2.pack_end(bt)
cnt += 1
if cnt < 1:
frame.delete()
示例2: __init__
def __init__(self, repo, win):
self.repo = repo
self.win = win
self.confirmed = False
StandardWindow.__init__(self, 'Egitu', 'Egitu', autodel=True)
vbox = Box(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(vbox)
vbox.show()
# title
en = Entry(self, editable=False,
text='<title><align=center>Commit changes</align></title>',
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
vbox.pack_end(en)
en.show()
panes = Panes(self, content_left_size = 0.2, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
vbox.pack_end(panes)
panes.show()
# message entry
en = Entry(self, editable=True, scrollable=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
en.part_text_set('guide', 'Enter commit message here')
panes.part_content_set("left", en)
en.show()
self.msg_entry = en
# diff entry
self.diff_entry = DiffedEntry(self)
panes.part_content_set("right", self.diff_entry)
self.diff_entry.show()
# buttons
hbox = Box(self, horizontal=True, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
vbox.pack_end(hbox)
hbox.show()
bt = Button(self, text="Cancel")
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
bt = Button(self, text="Commit")
bt.callback_clicked_add(self.commit_button_cb)
hbox.pack_end(bt)
bt.show()
# show the window and give focus to the editable entry
self.size = 500, 500
self.show()
en.focus = True
# load the diff
repo.request_diff(self.diff_done_cb, only_staged=True)
示例3: anchor_hover_opened
def anchor_hover_opened(obj, event_info):
print("We should have EntryAnchorHoverInfo here: %s" % (event_info))
print("EntryAnchorHoverInfo has the following properties and methods: %s" % (dir(event_info)))
print(event_info.anchor_info.name)
btn = Button(obj, text="Testing entry anchor")
event_info.hover.part_content_set("middle", btn)
btn.show()
示例4: __init__
def __init__(self, parent):
InnerWindow.__init__(self, parent)
vbox = Box(self)
vbox.show()
self.content = vbox
title = Label(self, scale=2.0, text='Edone %s' % VERSION)
title.show()
vbox.pack_end(title)
en = Entry(self, text=INFO, editable=False, scrollable=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
en.show()
vbox.pack_end(en)
sep = Separator(self, horizontal=True)
sep.show()
vbox.pack_end(sep)
close = Button(self, text='Close')
close.callback_clicked_add(lambda b: self.delete())
close.show()
vbox.pack_end(close)
self.activate()
示例5: build_prog_popup
def build_prog_popup(self):
pp = Popup(self)
pp.part_text_set('title,text', _('Extracting files, please wait...'))
pp.show()
vbox = Box(self)
pp.part_content_set('default', vbox)
vbox.show()
lb = Label(self, ellipsis=True, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
vbox.pack_end(lb)
lb.show()
pb = Progressbar(pp, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
vbox.pack_end(pb)
pb.show()
bt = Button(pp, text=_('Cancel'))
bt.callback_clicked_add(lambda b: self.app.abort_operation())
pp.part_content_set('button1', bt)
self.prog_pbar = pb
self.prog_label = lb
self.prog_popup = pp
示例6: _populate_done_cb
def _populate_done_cb(self, success):
# draw the last date piece
if self._last_date:
self.date_add(self._last_date, self._last_date_row,
self._current_row)
# draw still-open connections lines (and clear the old ones)
while self._open_connection_lines:
l = self._open_connection_lines.pop()
l.delete()
for key in self._open_connections:
for child_col, child_row, new_col in self._open_connections[key]:
l = self.connection_add(child_col, child_row,
child_col, self._current_row)
self._open_connection_lines.append(l)
# add the "show more" button if necessary
if self._open_connections:
bt = Button(self, text="Show more commits", size_hint_align=(0,0))
bt.callback_clicked_add(self._show_more_clicked_cb)
self.pack(bt, 0, self._current_row + 1, 10, 2)
bt.show()
# show the first commit in the diff view
if self._first_commit is not None:
self.win.show_commit(self._first_commit)
self._first_commit = None
示例7: __init__
def __init__(self, cmd, exec_cb):
DialogWindow.__init__(self, _app_instance.win, 'egitu-review',
'Git Command Review', autodel=True, size=(300,50))
# main table (inside a padding frame)
fr = Frame(self, style='default', text='Command to execute',
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
tb = Table(self, padding=(6,6),
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
fr.content = tb
tb.show()
# cmd entry
en = Entry(self, single_line=True, scrollable=True,
text=utf8_to_markup(cmd),
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
tb.pack(en, 0, 0, 2, 1)
en.show()
# buttons
bt = Button(self, text='Close', size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.delete())
tb.pack(bt, 0, 1, 1, 1)
bt.show()
bt = Button(self, text='Execute', size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(self._exec_clicked_cb, en, exec_cb)
tb.pack(bt, 1, 1, 1, 1)
bt.show()
#
self.show()
示例8: transit2_clicked
def transit2_clicked(obj, item=None):
win = StandardWindow("transit2", "Transit 2", autodel=True, size=(400, 400))
bt = Button(win, text="Resizing Effect", pos=(50, 100), size=(100, 50))
bt.show()
bt.callback_clicked_add(transit_resizing)
win.show()
示例9: cb_popup_center_title_text_1button
def cb_popup_center_title_text_1button(li, item, win):
popup = Popup(win, size_hint_weight=EXPAND_BOTH)
popup.text = "This Popup has content area and " \
"action area set, action area has one button Close"
bt = Button(win, text="Close")
bt.callback_clicked_add(cb_bnt_close, popup)
popup.part_content_set("button1", bt)
popup.show()
示例10: __init__
def __init__(self, ourParent, ourText, ourIcon=None, ourCB=None, *args, **kwargs):
Button.__init__(self, ourParent, *args, **kwargs)
icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
icon.standard_set(ourIcon)
icon.show()
self.text = ourText
self.content_set(icon)
self.callback_clicked_add(ourCB)
示例11: transit4_clicked
def transit4_clicked(obj, item=None):
win = StandardWindow("transit4", "Transit 4", autodel=True, size=(300, 300))
bt = Button(win, text="Zoom Effect", size=(100, 50), pos=(100, 125))
bt.show()
bt.callback_clicked_add(transit_zoom)
win.show()
示例12: __init__
def __init__(self, canvas, title, text):
n = Popup(canvas)
n.part_text_set("title,text", title)
n.text = text
b = Button(canvas)
b.text = "OK"
b.callback_clicked_add(lambda x: n.delete())
n.part_content_set("button1", b)
n.show()
示例13: __init__
def __init__(self, parent, app, branch):
self.app = app
self.branch = branch
Popup.__init__(self, parent)
self.part_text_set("title,text", "Delete branch")
self.part_content_set("title,icon", Icon(self, standard="user-trash"))
# main vertical box
box = Box(self)
self.content = box
box.show()
# sep
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_BOTH)
box.pack_end(sep)
sep.show()
# label
en = Entry(
self,
editable=False,
text="%s<br><br><hilight>%s</hilight><br>" % ("Are you sure you want to delete this branch?", branch.name),
size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH,
)
box.pack_end(en)
en.show()
# force checkbox
ck = Check(
self,
text="Force delete (even if not fully merged)",
size_hint_expand=EXPAND_BOTH,
size_hint_align=(0.0, 0.5),
)
box.pack_end(ck)
ck.show()
self.force_chk = ck
# buttons
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_BOTH)
box.pack_end(sep)
sep.show()
bt = Button(self, text="Cancel")
bt.callback_clicked_add(lambda b: self.delete())
self.part_content_set("button1", bt)
bt.show()
bt = Button(self, text="Delete branch")
bt.callback_clicked_add(self._delete_btn_cb)
self.part_content_set("button2", bt)
bt.show()
#
self.show()
示例14: __init__
def __init__(self, parent, repo):
self.repo = repo
Popup.__init__(self, parent)
self.part_text_set("title,text", "Add remote")
tb = Table(self, padding=(3, 3), size_hint_expand=EXPAND_BOTH)
self.content = tb
tb.show()
# name
lb = Label(tb, text="Name")
tb.pack(lb, 0, 0, 1, 1)
lb.show()
en = Entry(
tb, editable=True, single_line=True, scrollable=True, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH
)
en.part_text_set("guide", "Name for the new remote")
en.callback_changed_user_add(lambda e: self.err_unset())
tb.pack(en, 1, 0, 1, 1)
en.show()
self.name_entry = en
# url
lb = Label(tb, text="URL")
tb.pack(lb, 0, 1, 1, 1)
lb.show()
en = Entry(
tb, editable=True, single_line=True, scrollable=True, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH
)
en.part_text_set("guide", "git://git.example.com/repo.git")
en.callback_changed_user_add(lambda e: self.err_unset())
tb.pack(en, 1, 1, 1, 1)
en.show()
self.url_entry = en
# error label
lb = Label(tb, text="", size_hint_expand=EXPAND_HORIZ)
tb.pack(lb, 0, 2, 2, 1)
lb.show()
self.error_label = lb
# buttons
bt = Button(self, text="Cancel")
bt.callback_clicked_add(lambda b: self.delete())
self.part_content_set("button1", bt)
bt.show()
bt = Button(self, text="Add remote")
bt.callback_clicked_add(self._add_btn_cb)
self.part_content_set("button2", bt)
bt.show()
self.show()
示例15: showDialog
def showDialog(self, title, msg):
dia = Popup(self)
dia.part_text_set("title,text", title)
dia.part_text_set("default", msg)
bt = Button(dia, text="Ok")
bt.callback_clicked_add(lambda b: dia.delete())
dia.part_content_set("button1", bt)
dia.show()