本文整理汇总了Python中efl.elementary.button.Button.callback_pressed_add方法的典型用法代码示例。如果您正苦于以下问题:Python Button.callback_pressed_add方法的具体用法?Python Button.callback_pressed_add怎么用?Python Button.callback_pressed_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.button.Button
的用法示例。
在下文中一共展示了Button.callback_pressed_add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addPackage
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [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.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [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: buildDetailsWin
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [as 别名]
def buildDetailsWin(self):
self.updateText = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.updateText.editable_set(False)
self.updateText.scrollable_set(True)
self.updateText.show()
closebtn = Button(self)
closebtn.text_set("Done")
closebtn.callback_pressed_add(self.innerWinHide)
closebtn.show()
box = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box.pack_end(self.updateText)
box.pack_end(closebtn)
box.show()
self.innerWin = InnerWindow(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_HORIZ)
self.innerWin.content_set(box)
示例4: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [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
示例5: ourCommand
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [as 别名]
class ourCommand(object):
def __init__(self, cmd):
self.cmd = cmd
self.cmd_exe = None
win = self.win = Window("ecore-ex", ELM_WIN_DIALOG_BASIC)
win.title = "Ecore Example"
win.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
win.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
win.resize(300, 200)
win.callback_delete_request_add(lambda o: elementary.exit())
win.show()
win.activate()
self.sendEntry = Entry(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.sendEntry.show()
self.sendButton = Button(win, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
self.sendButton.text = "Send!"
self.sendButton.callback_pressed_add(self.sendPressed)
self.sendButton.show()
box = Box(win, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
box.pack_end(self.sendEntry)
box.pack_end(self.sendButton)
box.show()
win.resize_object_add(box)
self.run_command(cmd)
def sendPressed(self, btn):
print "Sending Data: %s"%(self.sendEntry.text)
if self.cmd_exe:
ourResult = self.cmd_exe.send("%s\n"%self.sendEntry.text)
print("Send Success: %s"%ourResult)
self.sendEntry.text = ""
def run_command(self, command):
self.cmd_exe = cmd = ecore.Exe(
command,
ecore.ECORE_EXE_PIPE_READ |
ecore.ECORE_EXE_PIPE_ERROR |
ecore.ECORE_EXE_PIPE_WRITE
)
cmd.on_add_event_add(self.command_started)
cmd.on_data_event_add(self.received_data)
cmd.on_error_event_add(self.received_error)
cmd.on_del_event_add(self.command_done)
def command_started(self, cmd, event, *args, **kwargs):
print("Command started.\n")
def received_data(self, cmd, event, *args, **kwargs):
print("Output: %s"%event.data)
def received_error(self, cmd, event, *args, **kwargs):
print("Error: %s" % event.data)
def command_done(self, cmd, event, *args, **kwargs):
print("Command done.")
elementary.exit()
示例6: FileSelector
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_pressed_add [as 别名]
#.........这里部分代码省略.........
self.filepathEntry.show()
self.filepathBox.pack_end(fileLabel)
self.filepathBox.pack_end(self.filepathEntry)
self.autocompleteHover = Hoversel(self, hover_parent=self)
self.autocompleteHover.callback_selected_add(self.autocompleteSelected)
#self.autocompleteHover.show()
self.fileSelectorBox = Panes(self, content_left_size=0.3,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.fileSelectorBox.show()
"""Bookmarks Box contains:
- Button - Up Arrow
- List - Home/Root/GTK bookmarks
- Box
-- Button - Add Bookmark
-- Button - Remove Bookmark"""
self.bookmarkBox = Box(self, size_hint_weight=(0.3, EVAS_HINT_EXPAND),
size_hint_align=FILL_BOTH)
self.bookmarkBox.show()
upIcon = Icon(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
upIcon.standard_set("go-up")
upIcon.show()
self.upButton = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, content=upIcon)
self.upButton.text = "Up"
self.upButton.callback_pressed_add(self.upButtonPressed)
self.upButton.show()
self.bookmarksList = List(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.bookmarksList.callback_activated_add(self.bookmarkDoubleClicked)
self.bookmarksList.show()
self.bookmarkModBox = Box(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
self.bookmarkModBox.horizontal = True
self.bookmarkModBox.show()
con = Icon(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
con.standard_set("add")
con.show()
self.addButton = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, content=con)
self.addButton.callback_pressed_add(self.addButtonPressed)
self.addButton.disabled = True
self.addButton.show()
con = Icon(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
con.standard_set("remove")
con.show()
self.removeButton = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, content=con)
self.removeButton.callback_pressed_add(self.removeButtonPressed)
self.removeButton.disabled = True