当前位置: 首页>>代码示例>>Python>>正文


Python Popup.part_content_set方法代码示例

本文整理汇总了Python中efl.elementary.popup.Popup.part_content_set方法的典型用法代码示例。如果您正苦于以下问题:Python Popup.part_content_set方法的具体用法?Python Popup.part_content_set怎么用?Python Popup.part_content_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在efl.elementary.popup.Popup的用法示例。


在下文中一共展示了Popup.part_content_set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: build_prog_popup

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [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
开发者ID:lonid,项目名称:epack,代码行数:28,代码来源:gui.py

示例2: cb_popup_center_title_text_1button

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_center_title_text_1button(li, item, win):
    popup = Popup(win, size_hint_weight=EXPAND_BOTH)
    popup.text = "This Popup has content area and " \
                 "action area set, action area has one button Close"
    bt = Button(win, text="Close")
    bt.callback_clicked_add(cb_bnt_close, popup)
    popup.part_content_set("button1", bt)
    popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:10,代码来源:test_popup.py

示例3: __init__

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
 def __init__(self, canvas, title, text):
     n = Popup(canvas)
     n.part_text_set("title,text", title)
     n.text = text
     b = Button(canvas)
     b.text = "OK"
     b.callback_clicked_add(lambda x: n.delete())
     n.part_content_set("button1", b)
     n.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:11,代码来源:Notify.py

示例4: showDialog

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
    def showDialog(self, title, msg):
        dia = Popup(self)
        dia.part_text_set("title,text", title)
        dia.part_text_set("default", msg)

        bt = Button(dia, text="Ok")
        bt.callback_clicked_add(lambda b: dia.delete())
        dia.part_content_set("button1", bt)

        dia.show()
开发者ID:jbenito,项目名称:bodhi3packages,代码行数:12,代码来源:eepDater.py

示例5: _confirm_delete

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
    def _confirm_delete(self, m, item):
        pp = Popup(self.top_widget, text=self._task.text)
        pp.part_text_set('title,text', 'Confirm task deletion?')

        btn = Button(pp, text='Cancel')
        btn.callback_clicked_add(lambda b: pp.delete())
        pp.part_content_set('button1', btn)

        btn = Button(pp, text='Delete Task')
        btn.callback_clicked_add(self._delete_confirmed, pp)
        pp.part_content_set('button2', btn)

        pp.show()
开发者ID:mwarchulinski,项目名称:edone,代码行数:15,代码来源:gui.py

示例6: show_error_msg

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
    def show_error_msg(self, msg):
        pop = Popup(self, text=msg)
        pop.part_text_set('title,text', _('Error'))

        btn = Button(self, text=_('Continue'))
        btn.callback_clicked_add(lambda b: pop.delete())
        pop.part_content_set('button1', btn)

        btn = Button(self, text=_('Exit'))
        btn.callback_clicked_add(lambda b: self.app.exit())
        pop.part_content_set('button2', btn)

        pop.show()
开发者ID:lonid,项目名称:epack,代码行数:15,代码来源:gui.py

示例7: cb_popup_center_title_text_2button_restack

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_center_title_text_2button_restack(li, item, win):
    popup = Popup(win, size_hint_weight=EXPAND_BOTH)
    popup.text = "When you click the 'Restack' button, " \
                 "an image will be located under this popup"
    popup.part_text_set("title,text", "Title")

    bt = Button(win, text="Restack")
    bt.callback_clicked_add(cb_btn_restack, popup)
    popup.part_content_set("button1", bt)

    bt = Button(win, text="Close")
    bt.callback_clicked_add(cb_bnt_close, popup)
    popup.part_content_set("button3", bt)

    popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:17,代码来源:test_popup.py

示例8: errorPopup

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [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()
开发者ID:emctoo,项目名称:ePad,代码行数:49,代码来源:ePad.py

示例9: cb_popup_center_text_1button_hide_show

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_center_text_1button_hide_show(li, item, win):
    global times
    global g_popup

    times += 1

    if g_popup is not None:
        g_popup.text = "You have checked this popup %d times." % times
        g_popup.show()
        return

    g_popup = Popup(win, size_hint_weight=EXPAND_BOTH)
    g_popup.text = "Hide this popup by using the button." \
                   "When you click list item again, you will see this popup again."

    bt = Button(win, text="Hide")
    bt.callback_clicked_add(lambda b: g_popup.hide())
    g_popup.part_content_set("button1", bt)

    g_popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:22,代码来源:test_popup.py

示例10: cb_popup_bottom_title_text_3button

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_bottom_title_text_3button(li, item, win):
    popup = Popup(win, size_hint_weight=EXPAND_BOTH,
        content_text_wrap_type=ELM_WRAP_CHAR)
    popup.text = "This Popup has title area, content area and " \
                 "action area set with content being character wrapped. " \
                 "action area has three buttons OK, Cancel and Close"
    popup.part_text_set("title,text", "Title")

    ic = Icon(win, file=os.path.join(img_path, "logo_small.png"))
    popup.part_content_set("title,icon", ic)

    bt = Button(win, text="OK")
    popup.part_content_set("button1", bt)

    bt = Button(win, text="Cancel")
    popup.part_content_set("button2", bt)

    bt = Button(win, text="Close")
    bt.callback_clicked_add(cb_bnt_close, popup)
    popup.part_content_set("button3", bt)

    popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:24,代码来源:test_popup.py

示例11: cb_popup_center_title_content_3button

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_center_title_content_3button(li, item, win):
    ic = Icon(win, file=os.path.join(img_path, "logo_small.png"))
    bt = Button(win, text="Content", content=ic)

    popup = Popup(win, size_hint_weight=EXPAND_BOTH, content=bt)
    popup.part_text_set("title,text", "Title")

    bt = Button(win, text="OK")
    popup.part_content_set("button1", bt)

    bt = Button(win, text="Cancel")
    popup.part_content_set("button2", bt)

    bt = Button(win, text="Close")
    bt.callback_clicked_add(cb_bnt_close, popup)
    popup.part_content_set("button3", bt)

    popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:20,代码来源:test_popup.py

示例12: safe_quit

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
    def safe_quit(self):
        if need_save() is False:
            elm.exit()
        else:
            pp = Popup(self, text="You have unsave changes, if you don't save now all your recent modification will be lost.")
            pp.part_text_set('title,text', 'Save changes to your txt file?')

            btn = Button(pp, text='Close without saving')
            btn.callback_clicked_add(lambda b: elm.exit())
            pp.part_content_set('button1', btn)

            btn = Button(pp, text='Cancel')
            btn.callback_clicked_add(lambda b: pp.delete())
            pp.part_content_set('button2', btn)

            btn = Button(pp, text='Save')
            btn.callback_clicked_add(lambda b: self.save(True))
            pp.part_content_set('button3', btn)

            pp.show()
开发者ID:mwarchulinski,项目名称:edone,代码行数:22,代码来源:gui.py

示例13: cb_popup_center_title_item_3button

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
def cb_popup_center_title_item_3button(li, item, win):
    popup = Popup(win, size_hint_weight=EXPAND_BOTH)
    popup.part_text_set("title,text", "Title")

    for i in range(1, 11):
        if i in [3, 5, 6]:
            ic = Icon(win, file=os.path.join(img_path, "logo_small.png"))
            popup.item_append("item"+str(i), ic)
        else:
            popup.item_append("item"+str(i), None)

    bt = Button(win, text="OK")
    popup.part_content_set("button1", bt)

    bt = Button(win, text="Cancel")
    popup.part_content_set("button2", bt)

    bt = Button(win, text="Close")
    bt.callback_clicked_add(cb_bnt_close, popup)
    popup.part_content_set("button3", bt)

    popup.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:24,代码来源:test_popup.py

示例14: _popup_build

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [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()
开发者ID:mwarchulinski,项目名称:edone,代码行数:25,代码来源:gui.py

示例15: _task_edit_start

# 需要导入模块: from efl.elementary.popup import Popup [as 别名]
# 或者: from efl.elementary.popup.Popup import part_content_set [as 别名]
    def _task_edit_start(self, task):
        pp = Popup(self.top_widget)
        pp.part_text_set('title,text', 'Edit task')

        en = Entry(pp, editable=True, single_line=True, scrollable=True,
                   text=task.raw_txt)
        en.callback_activated_add(lambda e: self._task_edit_end(task, en, pp))
        en.callback_aborted_add(lambda e: pp.delete())
        pp.part_content_set('default', en)

        b = Button(pp, text='Cancel')
        b.callback_clicked_add(lambda b: pp.delete())
        pp.part_content_set('button1', b)

        b = Button(pp, text='Accept')
        b.callback_clicked_add(lambda b: self._task_edit_end(task, en, pp))
        pp.part_content_set('button2', b)

        pp.show()

        en.cursor_begin_set()
        en.cursor_selection_begin()
        en.cursor_end_set()
        en.cursor_selection_end()
开发者ID:mwarchulinski,项目名称:edone,代码行数:26,代码来源:gui.py


注:本文中的efl.elementary.popup.Popup.part_content_set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。