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


Python Button.content方法代码示例

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


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

示例1: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import content [as 别名]
    def __init__(self):
        # main widget 'pointers'
        self.tasks_list = None
        self.filters = None
        self.task_note = None
        self.search_entry = None
        self.main_panes = None

        # the window
        StandardWindow.__init__(self, "edone", "Edone")
        self.callback_delete_request_add(lambda o: self.safe_quit())
        # self.focus_highlight_enabled = True

        # main vertical box
        vbox = Box(self, size_hint_weight=EXPAND_BOTH)
        self.resize_object_add(vbox)
        vbox.show()

        ### Header ###
        hbox1 = Box(vbox, horizontal=True)
        fr = Frame(vbox, style='outdent_bottom', content=hbox1,
                   size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
        vbox.pack_end(fr)
        fr.show()

        # menu button
        m = OptionsMenu(hbox1)
        hbox1.pack_end(m)
        m.show()

        # new task button
        b = Button(hbox1, text='New Task', focus_allow=False)
        b.content = Icon(hbox1, standard='add')
        b.callback_clicked_add(lambda b: self.task_add())
        hbox1.pack_end(b)
        b.show()

        # title
        title = Label(hbox1, text="Getting Things Done", scale=2.0,
                      size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
        hbox1.pack_end(title)
        title.show()

        # search entry
        en = Entry(hbox1, single_line=True, scrollable=True,
                   size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
        en.part_text_set('guide', 'search')
        en.callback_changed_user_add(self._search_changed_user_cb)
        en.content_set('end', Icon(en, standard='find', size_hint_min=(20,20)))
        hbox1.pack_end(en)
        en.show()
        self.search_entry = en

        ### Main horizontal box ###
        hbox = Box(vbox, horizontal=True,
                   size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        vbox.pack_end(hbox)
        hbox.show()

        # the filters box widget (inside a padding frame)
        self.filters = Filters(hbox)
        fr = Frame(hbox, style='pad_medium', content=self.filters,
                   size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT)
        hbox.pack_end(fr)
        fr.show()

        ### the main panes (horiz or vert)
        panes = Panes(hbox, horizontal=not options.horiz_layout,
                      content_left_min_relative_size=0.3,
                      content_right_min_relative_size=0.1,
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        panes.content_left_size = 1.0
        hbox.pack_end(panes)
        panes.show()
        self.main_panes = panes

        ### the tasks list ###
        self.tasks_list = TasksList(panes)
        panes.part_content_set("left", self.tasks_list)

        ### the single task view ###
        self.task_note = TaskNote(panes)
        panes.part_content_set("right", self.task_note)

        # show the window
        self.resize(800, 600)
        self.show()
开发者ID:mwarchulinski,项目名称:edone,代码行数:89,代码来源:gui.py

示例2: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import content [as 别名]
    def __init__(self):
        self.repo = None
        self.branch_selector = None
        self.caption_label = None
        self.status_label = None
        self.graph = None
        self.diff_view = None

        StandardWindow.__init__(self, "egitu", "Efl GIT gUi - Egitu")
        self.autodel_set(True)
        self.callback_delete_request_add(lambda o: elm.exit())

        # main vertical box
        box = Box(self, size_hint_weight = EXPAND_BOTH)
        self.resize_object_add(box)
        box.show()

        # header
        fr = Frame(self, style="outdent_bottom", size_hint_weight=EXPAND_HORIZ,
                   size_hint_align=FILL_BOTH)
        box.pack_end(fr)
        fr.show()

        tb = Table(self, size_hint_weight=EXPAND_HORIZ,
                  size_hint_align=FILL_BOTH)
        fr.content = tb
        tb.show()

        # main menu button
        bt = Button(self, text='Menu')
        bt.content = Icon(self, standard='home')
        bt.callback_clicked_add(lambda b: EgituMenu(self, b))
        tb.pack(bt, 0, 0, 1, 1)
        bt.show()

        # editable description entry
        self.caption_label = EditableDescription(self)
        tb.pack(self.caption_label, 1, 0, 1, 1)
        self.caption_label.show()

        # branch selector
        lb = Label(self, text='On branch')
        tb.pack(lb, 2, 0, 1, 1)
        lb.show()

        self.branch_selector = Hoversel(self, text='none')
        self.branch_selector.callback_selected_add(self.branch_selected_cb)
        tb.pack(self.branch_selector, 3, 0, 1, 1)
        self.branch_selector.show()

        # status label + button
        self.status_label = lb = Entry(self, single_line=True, editable=False)
        tb.pack(lb, 4, 0, 1, 1)
        lb.show()

        ### Main content (left + right panes)
        panes = Panes(self, content_left_size = 0.5,
                       size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        box.pack_end(panes)
        panes.show()

        # the dag graph inside a scroller on the left
        self.graph = DagGraph(self, self.repo)
        fr = Frame(self, style="pad_medium", content=self.graph)
        scr = Scroller(self, content=fr,
                       size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        scr.bounce_set(0, 1)
        panes.part_content_set("left", scr)

        # the diff viewer on the right
        self.diff_view = DiffViewer(self, self.repo)
        self.diff_view.size_hint_weight = EXPAND_BOTH
        self.diff_view.size_hint_align = 0.0, 0.0
        panes.part_content_set("right", self.diff_view)

        self.resize(800, 600)
        self.show()
开发者ID:simotek,项目名称:egitu,代码行数:79,代码来源:gui.py


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