本文整理汇总了Python中efl.elementary.label.Label.text方法的典型用法代码示例。如果您正苦于以下问题:Python Label.text方法的具体用法?Python Label.text怎么用?Python Label.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.label.Label
的用法示例。
在下文中一共展示了Label.text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addPackage
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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)
示例2: buildLoadBox
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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
示例3: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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)
示例4: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def __init__(self, canvas, text):
n = Notify(canvas)
l = Label(canvas)
l.text = text
n.content = l
n.timeout = 3
n.show()
示例5: fileExists
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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()
示例6: sort_by_column
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def sort_by_column(self, col, ascending=True):
assert col >= 0
assert col < len(self.header_row)
self.header_row[self.sort_column].icon = None
btn = self.header_row[col]
ic = Label(btn)
btn.part_content_set("icon", ic)
ic.show()
if ascending == True: #ascending:
ic.text = u"⬇"
self.sort_column_ascending = True
else:
ic.text = u"⬆"
self.sort_column_ascending = False
orig_col = [
(i, x[col].data.get("sort_data", x[col].text)) \
for i, x in enumerate(self.rows)
]
sorted_col = sorted(orig_col, key=lambda e: e[1])
new_order = [x[0] for x in sorted_col]
# print(new_order)
if not ascending:
new_order.reverse()
# print(new_order)
for bx in self.lists:
bx.unpack_all()
for new_y in new_order:
self.add_row(self.rows[new_y])
self.rows.sort(
key=lambda e: e[col].data.get("sort_data", e[col].text),
#reverse=False if ascending else True
)
self.sort_column = col
示例7: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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)
示例8: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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()
示例9: sort_by_column
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def sort_by_column(self, col, ascending=True):
assert col >= 0
assert col < len(self.header_row)
if self.sort_column:
self.header_row[self.sort_column].icon = None
btn = self.header_row[col]
ic = Label(btn)
btn.part_content_set("icon", ic)
ic.show()
if ascending == True: # ascending:
ic.text = u"⬇"
self.sort_column_ascending = True
else:
ic.text = u"⬆"
self.sort_column_ascending = False
self.rows.sort(
key=lambda e: e[col],
# reverse=False if ascending else True
)
if not ascending:
self.rows.reverse()
# Clear old data
for our_list in self.lists:
our_list.clear()
for row in self.rows:
self.add_row(row)
self.sort_column = col
示例10: errorPopup
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [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()
示例11: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def __init__( self ):
win = StandardWindow("Testing", "Elementary About Dialog")
win.callback_delete_request_add(lambda o: elm.exit())
win.show()
lbl = Label(win, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
lbl.text = "This is a parent window for the About Dialog. Close when done."
lbl.show()
win.resize_object_add(lbl)
win.resize(600, 400)
win.show()
AboutWindow(win, title="About Test", standardicon="dialog-information", \
version="1.0", authors=AUTHORS, \
licen=LICENSE, webaddress="https://github.com/JeffHoogland/python-elm-extensions", \
info=INFO)
示例12: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def __init__(self):
StandardWindow.__init__(self, "ex2", "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()
ourButton = Button(self)
ourButton.size_hint_weight = EXPAND_BOTH
ourButton.text = "Goodbye Elementary"
ourButton.callback_clicked_add(self.buttonPressed)
ourButton.show()
ourBox = Box(self)
ourBox.size_hint_weight = EXPAND_BOTH
ourBox.pack_end(ourLabel)
ourBox.pack_end(ourButton)
ourBox.show()
self.resize_object_add(ourBox)
示例13: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def __init__( self ):
win = StandardWindow("Testing", "Elementary Tabbed Widget")
win.callback_delete_request_add(lambda o: elm.exit())
tabbs = TabbedBox(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tabbs.closeCallback = self.closeChecks
for i in range(10):
lbl = Label(win)
lbl.text = "Tab %s"%i
lbl.show()
tabbs.addTab(lbl, "Tab %s"%i)
tabbs.disableTab(0)
tabbs.disableTab(3)
tabbs.show()
win.resize_object_add(tabbs)
win.resize(600, 400)
win.show()
示例14: __init__
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
def __init__(self):
self.mainWindow = StandardWindow("epad", "Untitled - ePad",
size=(600, 400))
self.mainWindow.callback_delete_request_add(self.closeChecks)
self.mainWindow.elm_event_callback_add(self.eventsCb)
icon = Icon(self.mainWindow,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
icon.standard_set('accessories-text-editor')
icon.show()
self.mainWindow.icon_object_set(icon.object_get())
self.mainBox = Box(self.mainWindow,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.mainBox.show()
self.newInstance = NEW_INSTANCE
self.mainTb = ePadToolbar(self, self.mainWindow)
self.mainTb.focus_allow = False
self.mainTb.show()
self.mainBox.pack_end(self.mainTb)
# Root User Notification
if os.geteuid() == 0:
printErr("Caution: Root User")
if NOTIFY_ROOT:
notifyBox = Box(self.mainWindow, horizontal=True)
notifyBox.show()
notify = Notify(self.mainWindow, size_hint_weight=EXPAND_BOTH,
align=(ELM_NOTIFY_ALIGN_FILL, 0.0),
content=notifyBox)
notifyLabel = Label(self.mainWindow)
notifyLabel.text = "<b><i>Root User</i></b>"
notifyBox.pack_end(notifyLabel)
notifyLabel.show()
self.mainBox.pack_end(notifyBox)
self.about = aboutWin(self, self.mainWindow)
self.about.hide()
# Initialize Text entry box and line label
# FIXME: self.wordwrap initialized by ePadToolbar
print("Word wrap Initialized: {0}".format(self.wordwrap))
self.entryInit()
# Build our file selector for saving/loading files
self.fileBox = Box(self.mainWindow,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.fileBox.show()
self.fileLabel = Label(self.mainWindow,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH, text="")
self.fileLabel.show()
self.lastDir = os.getenv("HOME")
self.fileSelector = Fileselector(self.mainWindow, is_save=False,
expandable=False, folder_only=False,
hidden_visible=SHOW_HIDDEN,
path=self.lastDir,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.fileSelector.callback_done_add(self.fileSelected)
self.fileSelector.callback_activated_add(self.fileSelected)
self.fileSelector.callback_directory_open_add(self.updateLastDir)
self.fileSelector.path_set(os.getcwd())
self.fileSelector.show()
self.fileBox.pack_end(self.fileLabel)
self.fileBox.pack_end(self.fileSelector)
# Flip object has the file selector on one side
# and the GUI on the other
self.flip = Flip(self.mainWindow, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.flip.part_content_set("front", self.mainBox)
self.flip.part_content_set("back", self.fileBox)
self.mainWindow.resize_object_add(self.flip)
self.flip.show()
self.isSaved = True
self.isNewFile = False
self.confirmPopup = None
self.fileExistsFlag = False
示例15: StandardWindow
# 需要导入模块: from efl.elementary.label import Label [as 别名]
# 或者: from efl.elementary.label.Label import text [as 别名]
win.show()
if __name__ == "__main__":
elementary.init()
win = StandardWindow("test", "python-elementary test application",
size=(320,520))
win.callback_delete_request_add(lambda x: elementary.exit())
box0 = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(box0)
box0.show()
lb = Label(win)
lb.text = "Please select a test from the list below<br>" \
"by clicking the test button to show the<br>" \
"test window."
lb.show()
fr = Frame(win, text="Information", content=lb)
box0.pack_end(fr)
fr.show()
items = [("Bubble", bubble_clicked),
]
li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box0.pack_end(li)
li.show()
for item in items: