本文整理汇总了Python中efl.elementary.label.Label.show方法的典型用法代码示例。如果您正苦于以下问题:Python Label.show方法的具体用法?Python Label.show怎么用?Python Label.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.label.Label
的用法示例。
在下文中一共展示了Label.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def __init__(self, parent, label_text, values, initial_value):
Box.__init__(self, parent)
self.vd = {
ELM_ACTIONSLIDER_LEFT: values[0],
ELM_ACTIONSLIDER_CENTER: values[1],
ELM_ACTIONSLIDER_RIGHT: values[2],
}
self.horizontal = True
self.size_hint_align = -1.0, 0.0
self.size_hint_weight = 1.0, 0.0
l = Label(parent)
l.text = label_text
l.show()
w = self.w = Actionslider(parent)
w.magnet_pos = ELM_ACTIONSLIDER_ALL
w.size_hint_align = -1.0, 0.0
w.size_hint_weight = 1.0, 0.0
w.show()
parts = "left", "center", "right"
for i, v in enumerate(values):
w.part_text_set(parts[i], str(v))
w.indicator_pos = values.index(initial_value) + 1
self.pack_end(l)
self.pack_end(w)
示例2: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label 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: build_prog_popup
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
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
示例4: addPackage
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label 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)
示例5: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label 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()
示例6: buildLoadBox
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label 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
示例7: fileExists
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def fileExists(self, filePath):
self.confirmPopup = Popup(self.mainWindow,
size_hint_weight=EXPAND_BOTH)
# Add a table to hold dialog image and text to Popup
tb = Table(self.confirmPopup, size_hint_weight=EXPAND_BOTH)
self.confirmPopup.part_content_set("default", tb)
tb.show()
# Add dialog-error Image to table
need_ethumb()
icon = Icon(self.confirmPopup, thumb='True')
icon.standard_set('dialog-question')
# Using gksudo or sudo fails to load Image here
# unless options specify using preserving their existing environment.
# may also fail to load other icons but does not raise an exception
# in that situation.
# Works fine using eSudo as a gksudo alternative,
# other alternatives not tested
try:
dialogImage = Image(self.confirmPopup,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH,
file=icon.file_get())
tb.pack(dialogImage, 0, 0, 1, 1)
dialogImage.show()
except RuntimeError:
# An error message is displayed for this same error
# when aboutWin is initialized so no need to redisplay.
pass
# Add dialog text to table
dialogLabel = Label(self.confirmPopup, line_wrap=ELM_WRAP_WORD,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
current_file = os.path.basename(filePath)
dialogLabel.text = "'%s' already exists. Overwrite?<br><br>" \
% (current_file)
tb.pack(dialogLabel, 1, 0, 1, 1)
dialogLabel.show()
# Close without saving button
no_btt = Button(self.mainWindow)
no_btt.text = "No"
no_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
no_btt.show()
# Save the file and then close button
sav_btt = Button(self.mainWindow)
sav_btt.text = "Yes"
sav_btt.callback_clicked_add(self.doSelected)
sav_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
sav_btt.show()
# add buttons to popup
self.confirmPopup.part_content_set("button1", no_btt)
self.confirmPopup.part_content_set("button3", sav_btt)
self.confirmPopup.show()
示例8: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def __init__(self):
StandardWindow.__init__(self, "ex1", "Hello Elementary", size=(300, 200))
self.callback_delete_request_add(lambda o: elm.exit())
ourLabel = Label(self)
ourLabel.size_hint_weight = EXPAND_BOTH
ourLabel.text = "Hello Elementary!"
ourLabel.show()
self.resize_object_add(ourLabel)
示例9: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def __init__( self ):
win = StandardWindow("Testing", "Elementary Sorted Table")
win.callback_delete_request_add(lambda o: elm.exit())
"""Build the titles for the table. The titles is a list of tuples with the following format:
( <String - Header Text>, <Bool - Sortable> )"""
titles = []
for i in range(COLUMNS):
titles.append(
("Column " + str(i), True if i != 2 else False)
)
#Create our sorted list object
slist = SortedList(win, titles=titles, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
#Populate the rows in our table
for i in range(ROWS):
#Each row is a list with the number of elements that must equal the number of headers
row = []
for j in range(COLUMNS):
#Row elements can be ANY elementary object
if j == 0:
#For the first column in each row, we will create a button that will delete the row when pressed
btn = Button(slist, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
btn.text = "Delete row"
btn.callback_clicked_add(
lambda x, y=row: slist.row_unpack(y, delete=True)
)
btn.show()
#Add the btn created to our row
row.append(btn)
else:
#For each other row create a label with a random number
data = random.randint(0, ROWS*COLUMNS)
lb = Label(slist, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
lb.text=str(data)
"""For integer data we also need to assign value to "sort_data" because otherwise things get sorted as text"""
lb.data["sort_data"] = data
lb.show()
#Append our label to the row
row.append(lb)
#Add the row into the SortedList
slist.row_pack(row, sort=False)
#Show the list
slist.show()
win.resize_object_add(slist)
win.resize(600, 400)
win.show()
示例10: update_ui
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def update_ui(self, listing_in_progress=False):
box = self.header_box
box.clear()
ui_disabled = True
# file listing in progress
if listing_in_progress:
spin = Progressbar(box, style='wheel', pulse_mode=True)
spin.pulse(True)
spin.show()
box.pack_end(spin)
lb = Label(box, text=_('Reading archive, please wait...'),
size_hint_weight=EXPAND_HORIZ,
size_hint_align=(0.0, 0.5))
lb.show()
box.pack_end(lb)
# or header button
else:
if self.app.file_name is None:
txt = _('No archive loaded, click to choose a file')
else:
ui_disabled = False
txt = _('<b>Archive:</b> %s') % \
(os.path.basename(self.app.file_name))
txt = '<align=left>%s</align>' % txt
lb = Label(box, ellipsis=True, text=txt)
bt = Button(box, content=lb, size_hint_weight=EXPAND_HORIZ,
size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(lambda b: \
FileSelectorInwin(self, _('Choose an archive'),
self._archive_selected_cb,
path=os.getcwd()))
box.pack_end(bt)
bt.show()
# always show the about button
sep = Separator(box)
box.pack_end(sep)
sep.show()
ic = SafeIcon(box, 'help-about', size_hint_min=(24,24))
ic.callback_clicked_add(lambda i: InfoWin(self))
box.pack_end(ic)
ic.show()
for widget in (self.extract_btn, self.fsb,
self.create_folder_chk, self.del_chk):
widget.disabled = ui_disabled
self.update_fsb_label()
示例11: cnp_clicked
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def cnp_clicked(obj):
win = StandardWindow("copypaste", "CopyPaste", autodel=True)
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
gd = Grid(win, size=(100, 100), size_hint_weight=EXPAND_BOTH)
win.resize_object_add(gd)
gd.show()
en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
text="Elementary provides ")
gd.pack(en, 10, 10, 60, 30)
en.show()
bt = Button(win, text="Copy from left entry")
bt.callback_clicked_add(bt_copy_clicked, en)
gd.pack(bt, 70, 10, 22, 30)
bt.show()
bt = Button(win, text="Clear clipboard")
bt.callback_clicked_add(bt_clear_clicked, en)
gd.pack(bt, 70, 70, 22, 20)
bt.show()
en = Entry(win, scrollable=True, line_wrap=ELM_WRAP_CHAR,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
text="rich copying and pasting functionality,")
gd.pack(en, 10, 40, 60, 30)
en.show()
bt = Button(win, text="Paste to left entry")
bt.callback_clicked_add(bt_paste_clicked, en)
gd.pack(bt, 70, 40, 22, 30)
bt.show()
lb = Label(win, text="<b>Clipboard:</b>", size_hint_weight=(0.0, 0.0),
size_hint_align=FILL_BOTH)
gd.pack(lb, 10, 70, 60, 10)
lb.show()
global glb
glb = Label(win, text="", size_hint_weight=(0.0, 0.0),
size_hint_align=FILL_BOTH)
gd.pack(glb, 10, 80, 60, 10)
glb.show()
win.size = 480, 200
win.show()
示例12: popup_created
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def popup_created(self, popup):
super().popup_created(popup)
# add all the available players to the popup edje box
for player in self.mpris.players:
self.popup_player_add(popup, player)
# add all the channel sliders
if self.pulse.conn is not None:
for ch in self.pulse.channels:
self.popup_volume_add(popup, ch)
else:
lb = Label(popup, text='Cannot connect to PulseAudio')
lb.show()
popup.part_box_append('volumes.box', lb)
示例13: errorPopup
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def errorPopup(window, errorMsg):
errorPopup = Popup(window, size_hint_weight=EXPAND_BOTH)
errorPopup.callback_block_clicked_add(lambda obj: errorPopup.delete())
# Add a table to hold dialog image and text to Popup
tb = Table(errorPopup, size_hint_weight=EXPAND_BOTH)
errorPopup.part_content_set("default", tb)
tb.show()
# Add dialog-error Image to table
need_ethumb()
icon = Icon(errorPopup, thumb='True')
icon.standard_set('dialog-warning')
# Using gksudo or sudo fails to load Image here
# unless options specify using preserving their existing environment.
# may also fail to load other icons but does not raise an exception
# in that situation.
# Works fine using eSudo as a gksudo alternative,
# other alternatives not tested
try:
dialogImage = Image(errorPopup,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH,
file=icon.file_get())
tb.pack(dialogImage, 0, 0, 1, 1)
dialogImage.show()
except RuntimeError:
# An error message is displayed for this same error
# when aboutWin is initialized so no need to redisplay.
pass
# Add dialog text to table
dialogLabel = Label(errorPopup, line_wrap=ELM_WRAP_WORD,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
dialogLabel.text = errorMsg
tb.pack(dialogLabel, 1, 0, 1, 1)
dialogLabel.show()
# Ok Button
ok_btt = Button(errorPopup)
ok_btt.text = "Ok"
ok_btt.callback_clicked_add(lambda obj: errorPopup.delete())
ok_btt.show()
# add button to popup
errorPopup.part_content_set("button3", ok_btt)
errorPopup.show()
示例14: DestinationButton
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
class DestinationButton(Button):
def __init__(self, app, parent):
self.app = app
self._text = ''
Button.__init__(self, parent,size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
self.callback_clicked_add(self._btn_clicked_cb)
box = Box(self, horizontal=True, padding=(3,0))
self.content = box
box.show()
icon = Icon(box, standard='folder', size_hint_min=(16,16))
box.pack_end(icon)
icon.show()
self.label = Label(box, ellipsis=True,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
box.pack_end(self.label)
self.label.show()
def _btn_clicked_cb(self, btn):
if os.path.isdir(self._text):
path = self._text
elif os.path.isdir(os.path.dirname(self._text)):
path = os.path.dirname(self._text)
else:
path = os.getcwd()
FileSelectorInwin(self.app.main_win, _('Choose destination'),
self._fs_done_cb, folder_only=True,
path=path)
def _fs_done_cb(self, path):
if path:
self.app.dest_folder = path
self.app.main_win.update_fsb_label()
@property
def text(self):
return self._text
@text.setter
def text(self, text):
self._text = text
self.label.text = '<align=left>%s</align>' % text
示例15: cb_menu_overlay_bubble
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import show [as 别名]
def cb_menu_overlay_bubble(menu, item, Map, lon, lat):
ov = Map.overlay_add(lon, lat)
bub = Map.overlay_bubble_add()
bub.follow(ov)
lb = Label(Map, text="You can push contents here")
bub.content_append(lb)
lb.show()
ic = Icon(Map, file=os.path.join(img_path, "sky_01.jpg"))
ic.size_hint_min = 50, 50
bub.content_append(ic)
ic.show()
bt = Button(Map, text="clear me")
bt.callback_clicked_add(lambda bt:bub.content_clear())
bub.content_append(bt)
bt.show()