本文整理汇总了Python中efl.elementary.button.Button.show方法的典型用法代码示例。如果您正苦于以下问题:Python Button.show方法的具体用法?Python Button.show怎么用?Python Button.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.button.Button
的用法示例。
在下文中一共展示了Button.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def __init__(self, parent, session):
Frame.__init__(self, parent)
self.session = session
self.size_hint_align = FILL_HORIZ
self.text = "Listen port (range)"
port = session.listen_port()
b = Box(parent)
b.size_hint_weight = EXPAND_HORIZ
lp = self.lp = RangeSpinners(
parent,
low = session.conf.getint("Settings", "listen_low"),
high = session.conf.getint("Settings", "listen_high"),
minim = 0, maxim = 65535)
lp.show()
b.pack_end(lp)
save = Button(parent)
save.text = "Apply"
save.callback_clicked_add(self.save_cb)
save.show()
b.pack_end(save)
b.show()
self.content = b
示例2: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()
示例3: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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)
示例4: table5_clicked
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def table5_clicked(obj, item=None):
win = StandardWindow("table5", "Table 5", autodel=True)
tb = Table(win, homogeneous=True, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(tb)
tb.show()
bt = Button(win, text="A", size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
tb.pack(bt, 33, 0, 34, 33)
bt.show()
bt = Button(win, text="B", size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
tb.pack(bt, 67, 33, 33, 34)
bt.show()
bt = Button(win, text="C", size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
tb.pack(bt, 33, 67, 34, 33)
bt.show()
bt = Button(win, text="D", size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
tb.pack(bt, 0, 33, 33, 34)
bt.show()
bt = Button(win, text="X", size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
tb.pack(bt, 33, 33, 34, 34)
bt.show()
win.show()
示例5: menu_create
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()
示例6: anchor_hover_opened
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()
示例7: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()
示例8: _populate_done_cb
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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
示例9: header_row_pack
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def header_row_pack(self, titles):
"""Takes a list (or a tuple) of tuples (string, bool) and packs them to
the first row of the table."""
assert isinstance(titles, (list, tuple))
for t in titles:
assert isinstance(t, tuple)
assert len(t) == 2
title, sortable = t
assert isinstance(title, basestring)
assert isinstance(sortable, bool)
def sort_btn_cb(button, col):
if self.sort_column == col:
self.reverse()
else:
self.sort_by_column(col)
for count, t in enumerate(titles):
title, sortable = t
btn = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, text=title)
btn.callback_clicked_add(sort_btn_cb, count)
if not sortable:
btn.disabled = True
btn.show()
self.pack(btn, count, 0, 1, 1)
self.header_row.append(btn)
示例10: addTab
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def addTab(self, widget, tabName, canClose=True, disabled=False):
self.tabs.append(widget)
btn = Button(self.buttonBox, style="anchor", size_hint_align=ALIGN_LEFT)
btn.text = tabName
btn.data["widget"] = widget
btn.disabled = disabled
btn.callback_clicked_add(self.showTab, widget)
btn.show()
icn = Icon(self.buttonBox)
icn.standard_set("gtk-close")
icn.show()
cls = Button(self.buttonBox, content=icn, style="anchor", size_hint_align=ALIGN_LEFT)
cls.data["widget"] = widget
cls.callback_clicked_add(self.closeTab)
cls.disabled = disabled
if canClose:
cls.show()
sep = Separator(self.buttonBox, size_hint_align=ALIGN_LEFT)
sep.show()
self.buttonBox.pack_end(btn)
self.buttonBox.pack_end(cls)
self.buttonBox.pack_end(sep)
#Arguments go: btn, cls, sep
widget.data["close"] = cls
widget.data["button"] = btn
widget.data["sep"] = sep
self.showTab(widget=widget)
示例11: addPackage
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def addPackage(self, pak):
row = []
ourCheck = Check(self)
ourCheck.data['packageName'] = pak.name
ourCheck.callback_changed_add(self.app.checkChange)
ourCheck.show()
row.append(ourCheck)
ourName = Button(self, style="anchor", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
ourName.text = pak.name
ourName.data["packageDes"] = pak.candidate.description
ourName.callback_pressed_add(self.packagePressed)
ourName.show()
row.append(ourName)
ourVersion = Label(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=(0.1, 0.5))
ourVersion.text = pak.installed.version
ourVersion.show()
row.append(ourVersion)
newVersion = Label(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=(0.1, 0.5))
newVersion.text = pak.candidate.version
newVersion.show()
row.append(newVersion)
self.app.packagesToUpdate[pak.name] = {'check':ourCheck, 'selected':False}
self.packageList.row_pack(row, sort=False)
示例12: buildLoadBox
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def buildLoadBox(self):
# build the load label
loadLable = Label(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
loadLable.text = "<b>Processing</b>"
loadLable.show()
# build the spinning wheel
wheel = Progressbar(self, pulse_mode=True,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
wheel.pulse(True)
wheel.show()
detailsbtn = Button(self, style="anchor")
detailsbtn.text_set("Details")
detailsbtn.callback_pressed_add(self.innerWinShow)
detailsbtn.show()
# build the status label
self.statusLabel = Label(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
self.statusLabel.show()
# put all the built objects in a vertical box
box = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box.pack_end(loadLable)
box.pack_end(wheel)
box.pack_end(self.statusLabel)
box.pack_end(detailsbtn)
box.show()
return box
示例13: select_torrent
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
def select_torrent(self):
sel = Fileselector(self.win)
sel.expandable = False
sel.path_set(os.path.expanduser("~"))
sel.size_hint_weight_set(1.0, 1.0)
sel.size_hint_align_set(-1.0, -1.0)
sel.show()
sf = Frame(self.win)
sf.size_hint_weight_set(1.0, 1.0)
sf.size_hint_align_set(-1.0, -1.0)
sf.text = "Select torrent file"
sf.content = sel
sf.show()
magnet = Entry(self.win)
magnet.single_line = True
magnet.scrollable = True
if hasattr(magnet, "cnp_selection_get"):
magnet.cnp_selection_get(ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT)
else:
import pyperclip
t = pyperclip.paste()
if t is not None and t.startswith("magnet:"):
magnet.entry = t
magnet.show()
mf = Frame(self.win)
mf.size_hint_weight_set(1.0, 0.0)
mf.size_hint_align_set(-1.0, 0.0)
mf.text = "Or enter magnet URI here"
mf.content = magnet
mf.show()
mbtn = Button(self.win)
mbtn.text = "Done"
mbtn.show()
mbox = Box(self.win)
mbox.size_hint_weight_set(1.0, 0.0)
mbox.size_hint_align_set(-1.0, 0.0)
mbox.horizontal = True
mbox.pack_end(mf)
mbox.pack_end(mbtn)
mbox.show()
box = Box(self.win)
box.size_hint_weight = (1.0, 1.0)
box.size_hint_align = (-1.0, -1.0)
box.pack_end(sf)
box.pack_end(mbox)
box.show()
inwin = InnerWindow(self.win)
inwin.content = box
sel.callback_done_add(self.add_torrent_cb)
sel.callback_done_add(lambda x, y: inwin.delete())
mbtn.callback_clicked_add(self.add_magnet_uri_cb, magnet)
mbtn.callback_clicked_add(lambda x: inwin.delete())
inwin.activate()
示例14: transit2_clicked
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()
示例15: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import show [as 别名]
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()