本文整理汇总了Python中efl.elementary.popup.Popup.callback_block_clicked_add方法的典型用法代码示例。如果您正苦于以下问题:Python Popup.callback_block_clicked_add方法的具体用法?Python Popup.callback_block_clicked_add怎么用?Python Popup.callback_block_clicked_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.popup.Popup
的用法示例。
在下文中一共展示了Popup.callback_block_clicked_add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cb_popup_center_title_text_block_clicked_event
# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import callback_block_clicked_add [as 别名]
def cb_popup_center_title_text_block_clicked_event(li, item, win):
popup = Popup(win, size_hint_weight=EXPAND_BOTH)
popup.text = "This Popup has title area and content area. " \
"When clicked on blocked event region, popup gets deleted"
popup.part_text_set("title,text", "Title")
popup.callback_block_clicked_add(cb_bnt_close, popup)
popup.show()
示例2: errorPopup
# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import callback_block_clicked_add [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()
示例3: _popup_build
# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import callback_block_clicked_add [as 别名]
def _popup_build(self):
popup = Popup(self.top_widget)
popup.part_text_set('title,text',
'Choose the color for %s' % self._tag_name)
popup.callback_block_clicked_add(lambda p: popup.delete())
cs = Colorselector(popup, color=self._rect.color)
cs.callback_changed_add(lambda s: setattr(rect, 'color', cs.color))
popup.content = cs
rect = Rectangle(popup.evas, color=self._rect.color)
frame = Frame(popup, style='pad_small', content=rect)
popup.part_content_set('button1', frame)
bt = Button(popup, text='Accept')
bt.callback_clicked_add(self._popup_accept_cb, popup, cs)
popup.part_content_set('button2', bt)
bt = Button(popup, text='Cancel')
bt.callback_clicked_add(lambda b: popup.delete())
popup.part_content_set('button3', bt)
popup.show()
示例4: popup
# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import callback_block_clicked_add [as 别名]
def popup(self, tb, it):
msg = Popup(self.win, size_hint_weight=EXPAND_BOTH, text="Save Clicked")
msg.callback_block_clicked_add(self.closePopup)
msg.show()
it.selected_set(False)
示例5: aboutWin
# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import callback_block_clicked_add [as 别名]
#.........这里部分代码省略.........
icon = Icon(self.aboutDialog, thumb='True')
icon.standard_set('accessories-text-editor')
# 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:
aboutImage = Image(self.aboutDialog, no_scale=True,
size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH,
file=icon.file_get())
aboutImage.aspect_fixed_set(False)
mainBox.pack_end(aboutImage)
aboutImage.show()
except RuntimeError as msg:
print("Warning: to run as root please use:\n"
"\t gksudo -k or sudo -E \n"
"Continuing with minor errors ...")
labelBox = Box(self.aboutDialog, size_hint_weight=EXPAND_NONE)
mainBox.pack_end(labelBox)
labelBox.show()
# Entry to hold text
titleStr = '<br>ePad version <em>{0}</em><br>'.format(__version__)
aboutStr = ('<br>A simple text editor written in <br>'
'python and elementary<br>')
aboutLbTitle = Label(self.aboutDialog, style='marker')
aboutLbTitle.text = titleStr
aboutLbTitle.show()
labelBox.pack_end(aboutLbTitle)
sep = Separator(self.aboutDialog, horizontal=True)
labelBox.pack_end(sep)
sep.show()
aboutText = Label(self.aboutDialog)
aboutText.text = aboutStr
aboutText.show()
labelBox.pack_end(aboutText)
aboutCopyright = Label(self.aboutDialog)
aboutCopyright.text = '<b>Copyright</b> © <i>2014 Bodhi Linux</i><br>'
aboutCopyright.show()
labelBox.pack_end(aboutCopyright)
# Dialog Buttons
# Horizontal Box for Dialog Buttons
buttonBox = Box(self.aboutDialog, horizontal=True,
size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH, padding=PADDING)
buttonBox.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0)
buttonBox.show()
labelBox.pack_end(buttonBox)
# Credits Button
creditsBtn = Button(self.aboutDialog, text="Credits ",
size_hint_weight=EXPAND_NONE)
creditsBtn.callback_clicked_add(self.creditsPress)
creditsBtn.show()
buttonBox.pack_end(creditsBtn)
# Close Button
okBtn = Button(self.aboutDialog, text=" Close ",
size_hint_weight=EXPAND_NONE)
okBtn.callback_clicked_add(self.closeabout)
okBtn.show()
buttonBox.pack_end(okBtn)
# Ensure the min height
self.aboutDialog.resize(300, 100)
def creditsPress(self, obj):
# About popup
self.popupAbout = Popup(self.aboutDialog,
size_hint_weight=EXPAND_BOTH)
self.popupAbout.text = (
"Jeff Hoogland <<i>Jef91</i>><br><br>"
"Robert Wiley <<i>ylee</i>><br><br>"
"Kai Huuhko <<i>kuuko</i>><br>"
)
self.popupAbout.callback_block_clicked_add(self.cb_bnt_close)
self.popupAbout.show()
def cb_bnt_close(self, btn):
self.popupAbout.delete()
def closeabout(self, obj=False, trash=False):
self.aboutDialog.hide()
def launch(self, startingFile=False):
center = self._parent.mainWindow.center_get()
self.aboutDialog.center_set(center[0], center[1])
self.aboutDialog.show()