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


Python Entry.callback_clicked_add方法代码示例

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


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

示例1: __init__

# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_clicked_add [as 别名]
    def __init__(self, app):
        self.app = app

        DialogWindow.__init__(self, app.win, 'egitu-remotes', 'Remotes',
                              autodel=True, size=(600,400))

        # main vertical box (inside a padding frame)
        fr = Frame(self, style='pad_medium', size_hint_weight=EXPAND_BOTH)
        self.resize_object_add(fr)
        fr.show()

        box = Box(fr, padding=(6,6))
        fr.content = box
        box.show()

        # panes
        panes = Panes(box, content_left_size=0.25,
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        box.pack_end(panes)
        panes.show()

        ### remotes List (on the left)
        li = List(panes)
        li.callback_selected_add(self._list_selected_cb)
        panes.part_content_set('left', li)
        li.show()
        self.remotes_list = li

        ### remote info (on the right)
        tb = Table(self, padding=(4, 4))
        panes.part_content_set('right', tb)
        tb.show()

        # url
        lb = Label(self, text='URL', size_hint_align=(0.0,0.5))
        tb.pack(lb, 0, 0, 1, 1)
        lb.show()

        en = Entry(self, single_line=True, scrollable=True,
                   size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
        en.callback_changed_user_add(lambda e: \
                                setattr(self.save_url_btn, 'disabled', False))
        tb.pack(en, 1, 0, 1, 1)
        en.show()
        self.url_entry = en

        # fetch
        lb = Label(self, text='Fetch', size_hint_align=(0.0,0.5))
        tb.pack(lb, 0, 1, 1, 1)
        lb.show()

        en = Entry(self, single_line=True, scrollable=True, editable=False,
                   size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
        tb.pack(en, 1, 1, 1, 1)
        en.show()
        self.fetch_entry = en

        # save button
        bt = Button(self, text='Save', disabled=True,
                    size_hint_expand=EXPAND_VERT, size_hint_fill=FILL_VERT)
        bt.callback_clicked_add(self._save_url_clicked_cb)
        tb.pack(bt, 2, 0, 1, 1)
        bt.show()
        self.save_url_btn = bt

        # big info entry
        en = Entry(panes, scrollable=True, editable=False,
                   line_wrap=ELM_WRAP_NONE,
                   size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
        en.callback_clicked_add(self._info_clicked_cb)
        tb.pack(en, 0, 2, 3, 1)
        en.show()
        self.info_entry = en

        ### buttons bar
        hbox = Box(box, horizontal=True,
                   size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_BOTH)
        box.pack_end(hbox)
        hbox.show()

        bt = Button(hbox, text='Add')
        bt.callback_clicked_add(lambda b: RemoteAddPopup(self, self.app.repo))
        hbox.pack_end(bt)
        bt.show()

        bt = Button(hbox, text='Remove')
        bt.callback_clicked_add(self._remove_btn_cb)
        hbox.pack_end(bt)
        bt.show()

        bt = Button(hbox, text='Refresh')
        bt.callback_clicked_add(lambda b: self.restart_dialog())
        hbox.pack_end(bt)
        bt.show()

        sep = Separator(hbox, size_hint_expand=EXPAND_HORIZ)
        hbox.pack_end(sep)

        bt = Button(hbox, text='Close')
        bt.callback_clicked_add(lambda b: self.delete())
#.........这里部分代码省略.........
开发者ID:DaveMDS,项目名称:egitu,代码行数:103,代码来源:remotes.py

示例2: Interface

# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import callback_clicked_add [as 别名]
class Interface(object):
    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

    def entryInit(self):
        self.mainEn = Entry(self.mainWindow, scrollable=True,
                            line_wrap=self.wordwrap, autosave=False,
                            size_hint_weight=EXPAND_BOTH,
                            size_hint_align=FILL_BOTH)
        self.mainEn.callback_changed_user_add(self.textEdited)
        self.mainEn.elm_event_callback_add(self.eventsCb)
        self.mainEn.callback_clicked_add(resetCloseMenuCount)
        # delete line lable if it exist so we can create and add new one
        #    Later need to rethink logic here
        try:
            self.line_label.delete()
        except AttributeError:
            pass
#.........这里部分代码省略.........
开发者ID:emctoo,项目名称:ePad,代码行数:103,代码来源:ePad.py


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