本文整理汇总了Python中efl.elementary.frame.Frame.show方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.show方法的具体用法?Python Frame.show怎么用?Python Frame.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.frame.Frame
的用法示例。
在下文中一共展示了Frame.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: menu_create
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame 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()
示例2: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
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()
示例3: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, parent, text=None, icon=None):
Entry.__init__(self, parent, scrollable=True, single_line=True,
size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self.show()
if text: self.text = text
if icon: self.icon = icon
ic = SafeIcon(self, 'go-down')
ic.size_hint_min = 16, 16 # TODO file a bug for elm on phab
ic.callback_clicked_add(self.activate)
self.part_content_set('end', ic)
self._itc = GenlistItemClass(item_style='default',
text_get_func=self._gl_text_get,
content_get_func=self._gl_content_get)
self._list = Genlist(self)
self._list.callback_selected_add(self._list_selected_cb)
self._hover = Hover(self.parent, target=self)
self._bg = Background(self, size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
fr = Frame(self, style='pad_medium',
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
fr.content = self._list
fr.show()
self._table = Table(self, size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH)
self._table.pack(self._bg, 0, 0, 1, 1)
self._table.pack(fr, 0, 0, 1, 1)
self._selected_func = None
示例4: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, rent):
Box.__init__(self, rent)
self.parent = rent
#This appears on the button in the main swmai window
self.name = "Light DM"
#The section in the main window the button is added to
self.section = "System Settings"
#Search terms that this module should appear for
self.searchData = ["lightdm", "autologin", "login", "display"]
#Command line argument to open this module directly
self.launchArg = "--lightdm"
#Should be none by default. This value is used internally by swami
self.button = None
self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
#Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
self.icon.standard_set('video-display')
self.icon.show()
self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.mainBox.show()
self.config = {}
with open(LightDMConf) as f:
for line in f:
#Sections start with [ - such as [SeatDefaults]
if line[0] != "[":
setting, value = line.replace("\n", "").split("=")
e = Entry(self)
e.single_line_set(True)
e.text = value
e.show()
f = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
f.text = setting
f.content = e
f.show()
self.mainBox.pack_end(f)
self.config[setting] = f
buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
buttonBox.horizontal = True
buttonSave = StandardButton(self, "Save Changes", "ok", self.savePressed)
buttonSave.show()
buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
buttonReturn.show()
buttonBox.pack_end(buttonSave)
buttonBox.pack_end(buttonReturn)
buttonBox.show()
self.pack_end(self.mainBox)
self.pack_end(buttonBox)
示例5: select_torrent
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame 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()
示例6: FRAME
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def FRAME(win, bx, t):
bx2 = Box(win, size_hint_weight=EXPAND_HORIZ,
size_hint_align=(EVAS_HINT_FILL, 0.0), align=(0.0, 0.5))
bx2.show()
fr = Frame(bx, text=t, content=bx2, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
bx.pack_end(fr)
fr.show()
return fr, bx2
示例7: focus5_clicked
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def focus5_clicked(obj, item=None):
theme_overlay_add(os.path.join(script_path, "test_focus_custom.edj"))
win = StandardWindow("focus5", "Focus Custom", autodel=True, size=(320, 320))
win.focus_highlight_enabled = True
win.focus_highlight_animate = True
win.focus_highlight_style = "glow"
fr = Frame(win, style="pad_large",
size_hint_weight=EXPAND_BOTH);
win.resize_object_add(fr)
fr.show()
bx = Box(fr)
fr.content = bx
bx.show()
chk = Check(bx, text='Enable glow effect on "Glow" Button', state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(chk)
chk.show()
spinner = Spinner(bx, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(spinner)
spinner.show()
bt = Button(bx, text="Glow Button",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bt.callback_focused_add(_glow_effect_on_cb, win, chk)
bt.callback_unfocused_add(_glow_effect_off_cb, win, chk)
bx.pack_end(bt)
bt.show()
sp = Separator(bx, horizontal=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(sp)
sp.show()
bx2 = Box(bx, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range (1, 5):
bt = Button(bx2, text="Button %d" % i,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt)
bt.show()
win.show()
示例8: genlist10_clicked
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def genlist10_clicked(obj, item=None):
win = StandardWindow("genlist-decorate-item-mode",
"Genlist Decorate Item Mode", autodel=True, size=(520, 520))
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
bx2 = Box(win)
bx2.show()
fr = Frame(win, text="Decorate Item Mode Type", content=bx2)
bx.pack_end(fr)
fr.show()
rd = Radio(win, size_hint_weight=EXPAND_BOTH, state_value=0,
text="Slide : Sweep genlist items to the right.")
rd.show()
bx2.pack_end(rd)
rdg = rd
rd = Radio(win, size_hint_weight=EXPAND_BOTH, state_value=1,
text = "Rotate : Click each item.")
rd.group_add(rdg)
rd.show()
bx2.pack_end(rd)
gl = Genlist(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
gl.callback_drag_start_right_add(my_gl_mode_right, rdg)
gl.callback_drag_start_left_add(my_gl_mode_left, rdg)
gl.callback_drag_start_up_add(my_gl_mode_cancel, rdg)
gl.callback_drag_start_down_add(my_gl_mode_cancel, rdg)
gl.show()
itc10 = ItemClass10(item_style="default", decorate_item_style="mode")
itc10.state_get = gl_state_get
for i in range(1000, 1050):
GenlistItem(item_class=itc10,
item_data=i,
parent_item=None,
flags=ELM_GENLIST_ITEM_NONE,
func=gl_sel10,
func_data=(i, rdg)
).append_to(gl)
bx.pack_end(gl)
win.size = 520, 520
win.show()
示例9: entry_anchor_clicked
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [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()
示例10: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, parent_widget, titles=None, *args, **kwargs):
Box.__init__(self, parent_widget, *args, **kwargs)
self.outPut = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.outPut.editable_set(False)
self.outPut.scrollable_set(True)
self.outPut.callback_changed_add(self.changedCb)
self.outPut.show()
frame = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
frame.text = "Input:"
frame.autocollapse_set(True)
frame.collapse_go(True)
frame.show()
bx = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bx.horizontal = True
bx.show()
frame.content = bx
self.inPut = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.inPut.single_line_set(True)
self.inPut.callback_activated_add(self.enterPressed)
self.inPut.show()
enterButton = Button(self)
enterButton.text = "Execute"
enterButton.callback_pressed_add(self.enterPressed)
enterButton.show()
bx.pack_end(self.inPut)
bx.pack_end(enterButton)
self.pack_end(self.outPut)
self.pack_end(frame)
self.cmd_exe = None
self.done_cb = None
示例11: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, parent_widget, *args, **kwargs):
Box.__init__(self, parent_widget, *args, **kwargs)
self.ourList = ourList = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.keys = []
ourList.go()
ourList.show()
self.ourItems = []
sframe = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
sframe.text = "Search"
self.search = search = Entry(self)
search.single_line = True
search.callback_changed_add(self.searchChange)
sframe.content = search
search.show()
sframe.show()
self.pack_end(ourList)
self.pack_end(sframe)
示例12: Application
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
class Application(object):
def __init__(self):
self.cfg = ConfigOption()
self.userid = os.getuid()
self.win = None
self.bg = None
self.main_box = None
self.info_frame = None
self.lb = None
self.ps_list = None
self.win = StandardWindow("my app", "eyekill", size=(320, 384))
self.win.title_set("eye kill")
self.win.callback_delete_request_add(self.destroy)
self.main_box = Box(self.win)
self.main_box.size_hint_weight = EXPAND_BOTH
self.win.resize_object_add(self.main_box)
self.main_box.show()
self.info_frame = Frame(self.win)
self.info_frame.text_set("Information")
self.main_box.pack_end(self.info_frame)
self.info_frame.show()
self.lb = Label(self.win)
self.lb.text_set('<b>Kill process with a double click</b>')
self.info_frame.content_set(self.lb)
self.lb.show()
self.ps_list = List(self.win)
self.ps_list.size_hint_weight = EXPAND_BOTH
self.ps_list.size_hint_align = FILL_BOTH
self.ps_list.callback_clicked_double_add(self.kill_bill)
self.update_list()
self.main_box.pack_end(self.ps_list)
self.ps_list.go()
self.ps_list.show()
self.win.resize(320, 384)
self.win.show()
def destroy(self, obj):
# FIXME: but here self.cfg.save()???
elementary.exit()
def update_list(self):
if bool(self.cfg.get_desktop()):
for de in self.cfg.get_desktop():
ps = psutil.Process(get_pid_by_name(de))
pl = ps.children()
for p in pl:
if p.uids().real == self.userid:
if p.name not in self.cfg.get_process():
short_info = '%s / %s / %s' % (p.pid, p.name(), p.status())
self.ps_list.item_append(label = short_info, callback = self.update_info, p = p)
else:
pl = psutil.get_pid_list()
for p in pl:
p = psutil.Process(p)
if p.uids().real == self.userid:
if p.name() not in self.cfg.get_process():
short_info = '%s / %s / %s' % (p.pid, p.name(), p.status())
self.ps_list.item_append(label = short_info, callback = self.update_info, p = p)
def update_info(self,li , it, p):
info = ("PID %i STAT %s TIME %s<br/>MEM %s CPU %s COMMAND %s" % \
(p.pid,\
p.status(),\
p.get_cpu_times().user,\
hbytes(p.get_memory_info().rss),\
p.get_cpu_percent(interval=0),\
p.name()))
self.lb.text_set(info)
def kill_bill(self, obj, cb_data):
bill = cb_data.data_get()[1]['p'].pid
print ("%s ... Gotcha" % bill)
os.kill(bill, signal.SIGTERM)
if (os.kill(bill, 0)):
os.kill(bill, signal.SIGKILL)
item = obj.selected_item_get()
item.disabled_set(True)
示例13: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
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()
示例14: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, app):
self.app = app
self.selected_branch = None
DialogWindow.__init__(self, app.win, 'Egitu-branches', 'Branches',
size=(500,500), autodel=True)
# main vertical box (inside a padding frame)
vbox = Box(self, padding=(0, 6), size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
fr = Frame(self, style='pad_medium', size_hint_weight=EXPAND_BOTH)
self.resize_object_add(fr)
fr.content = vbox
fr.show()
vbox.show()
# title
en = Entry(self, editable=False, single_line=True,
text='<title>%s</title>' % 'Local branches',
size_hint_expand=EXPAND_HORIZ)
vbox.pack_end(en)
en.show()
# list
li = List(self, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
li.callback_selected_add(self._list_selected_cb)
vbox.pack_end(li)
li.show()
self.branches_list = li
# buttons
hbox = Box(self, horizontal=True,
size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
ic = SafeIcon(self, 'git-branch')
bt = Button(self, text='Create', content=ic)
bt.callback_clicked_add(lambda b: CreateBranchPopup(self, app))
hbox.pack_end(bt)
bt.show()
ic = SafeIcon(self, 'user-trash')
bt = Button(self, text='Delete', content=ic)
bt.callback_clicked_add(lambda b: DeleteBranchPopup(self, self.app,
self.selected_branch))
hbox.pack_end(bt)
bt.show()
self.delete_btn = bt
ic = SafeIcon(self, 'git-merge')
bt = Button(self, text='Merge', content=ic)
bt.callback_clicked_add(lambda b: MergeBranchPopup(self, app,
self.selected_branch.name))
hbox.pack_end(bt)
bt.show()
self.merge_btn = bt
ic = SafeIcon(self, 'git-compare')
bt = Button(self, text='Compare & Merge', content=ic)
bt.callback_clicked_add(lambda b: \
self.app.action_compare(target=self.selected_branch.name))
hbox.pack_end(bt)
bt.show()
self.merge_btn2 = bt
sep = Separator(self, size_hint_expand=EXPAND_HORIZ)
hbox.pack_end(sep)
bt = Button(self, text='Close')
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
# populate the list and show the dialog
self.populate()
self.show()
示例15: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import show [as 别名]
def __init__(self, rent):
Box.__init__(self, rent)
self.parent = rent
#This appears on the button in the main swmai window
self.name = "Startup Applications"
#The section in the main window the button is added to
self.section = "Applications"
#Search terms that this module should appear for
self.searchData = ["startup", "command", "applications", "apps"]
#Command line argument to open this module directly
self.launchArg = "--startupapps"
#Should be none by default. This value is used internally by swami
self.button = None
self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
#Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
self.icon.standard_set('system-run')
self.icon.show()
self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.mainBox.show()
buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
buttonBox.horizontal = True
buttonApply = StandardButton(self, "Apply", "ok", self.applyPressed)
buttonApply.show()
buttonFlip = StandardButton(self, "Startup Commands", "preferences-system", self.flipPressed)
buttonFlip.show()
buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
buttonReturn.show()
buttonBox.pack_end(buttonApply)
buttonBox.pack_end(buttonFlip)
buttonBox.pack_end(buttonReturn)
buttonBox.show()
startupApplications = []
with open(StartupApplicationsFile) as startupFile:
for line in startupFile:
startupApplications.append(line.rstrip())
desktopFiles = []
for ourPath in ApplicationPaths:
desktopFiles += [os.path.join(dp, f) for dp, dn, filenames in os.walk(ourPath) for f in filenames if os.path.splitext(f)[1] == '.desktop']
self.startupList = startupList = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.applicationsList = applicationsList = SearchableList(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
startupToAdd = []
applicationsToAdd = []
for d in desktopFiles:
with open(d) as desktopFile:
fileName = d.split("/")[-1]
icon = None
for line in desktopFile:
if line[:5] == "Name=":
name = line[5:][:-1]
if line[:5] == "Icon=":
icon = line[5:].strip()
try:
iconObj = Icon(self, standard=icon, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
except:
iconObj = Icon(self, standard="preferences-system", size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
icon = None
if fileName in startupApplications:
startupToAdd.append([name, iconObj, fileName, icon])
else:
applicationsToAdd.append([name, iconObj, fileName, icon])
startupToAdd.sort()
applicationsToAdd.sort()
for s in startupToAdd:
ourItem = startupList.item_append(s[0], s[1])
ourItem.data["file"] = s[2]
ourItem.data["icon"] = s[3]
#ourItem.append_to(startupList)
#startupList.item_append(ourItem)
for a in applicationsToAdd:
ourItem = applicationsList.item_append(a[0], a[1])
ourItem.data["file"] = a[2]
ourItem.data["icon"] = a[3]
#ourItem.append_to(applicationsList.ourList)
#applicationsList.item_append(a[0], a[1])
startupList.callback_clicked_double_add(self.startupAppRemove)
applicationsList.callback_clicked_double_add(self.startupAppAdd)
#.........这里部分代码省略.........