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


Python StandardWindow.focus_set方法代码示例

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


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

示例1: entry_scrolled_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_set [as 别名]

#.........这里部分代码省略.........
    # limit_filter_data.max_byte_count = 0
    # en.markup_filter_append(elm_entry_filter_limit_size, limit_filter_data)

    # # Byte size limited entry
    # en = ScrollableEntry(win)
    # en.size_hint_weight = EVAS_HINT_EXPAND, 0.0
    # en.size_hint_align = EVAS_HINT_FILL, 0.5
    # en.text = "And now only 30 bytes"
    # en.policy = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF
    # en.single_line = True
    # en.show()
    # bx.pack_end(en)

    # limit_filter_data2.max_char_count = 0
    # limit_filter_data2.max_byte_count = 30
    # en.markup_filter_append(elm_entry_filter_limit_size, limit_filter_data2)

    # Single line password entry
    en_p = ScrollableEntry(win, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=FILL_HORIZ, policy=SCROLL_POLICY_OFF,
        text="Password here", single_line=True, password=True)
    en_p.show()
    bx.pack_end(en_p)

    # entry with icon/end widgets
    en = ScrollableEntry(win, policy=SCROLL_POLICY_OFF,
        single_line=True, size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH, text="entry with icon and end objects")
    bt = Icon(win, standard="home", size_hint_min=(48, 48),
        color=(128, 0, 0, 128))
    bt.show()
    en.part_content_set("icon", bt)
    bt = Icon(win, standard="delete", size_hint_min=(48, 48),
        color=(128, 0, 0, 128))
    bt.show()
    en.part_content_set("end", bt)
    en.show()
    bx.pack_end(en)

    # markup entry
    en = ScrollableEntry(win, size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH, policy=SCROLL_POLICY_ON)
    en.text = "This is an entry widget in this window that<br/>"\
        "uses markup <b>like this</> for styling and<br/>"\
        "formatting <em>like this</>, as well as<br/>"\
        "<a href=X><link>links in the text</></a>, so enter text<br/>"\
        "in here to edit it. By them way, links are<br/>"\
        "called <a href=anc-02>Anchors</a> so you will need<br/>"\
        "to refer to them this way. At the end here is a really long "\
        "line to test line wrapping to see if it works. But just in "\
        "case this line is not long enough I will add more here to "\
        "really test it out, as Elementary really needs some "\
        "good testing to see if entry widgets work as advertised."
    en.callback_anchor_clicked_add(scrolled_anchor_test, en)
    en.show()
    bx.pack_end(en)

    bx2 = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=FILL_BOTH)

    bt = Button(win, text="Clear", size_hint_align=FILL_BOTH,
        size_hint_weight=EXPAND_HORIZ, propagate_events=False,
        focus_allow=False)
    bt.callback_clicked_add(scrolled_entry_bt_1, en)
    bx2.pack_end(bt)
    bt.show()

    bt = Button(win, text="Print", size_hint_align=FILL_BOTH,
        size_hint_weight=EXPAND_HORIZ, propagate_events=False,
        focus_allow=False)
    bt.callback_clicked_add(scrolled_entry_bt_2, en)
    bx2.pack_end(bt)
    bt.show()

    bt = Button(win, text="Print pwd", size_hint_align=FILL_BOTH,
        size_hint_weight=EXPAND_HORIZ, propagate_events=False,
        focus_allow=False)
    bt.callback_clicked_add(scrolled_entry_bt_5, en_p)
    bx2.pack_end(bt)
    bt.show()

    bt = Button(win, text="Selection", size_hint_align=FILL_BOTH,
        size_hint_weight=EXPAND_HORIZ, propagate_events=False,
        focus_allow=False)
    bt.callback_clicked_add(scrolled_entry_bt_3, en)
    bx2.pack_end(bt)
    bt.show()

    bt = Button(win, text="Insert", size_hint_align=FILL_BOTH,
        size_hint_weight=EXPAND_HORIZ, propagate_events=False,
        focus_allow=False)
    bt.callback_clicked_add(scrolled_entry_bt_4, en)
    bx2.pack_end(bt)
    bt.show()

    bx.pack_end(bx2)
    bx2.show()

    win.focus_set(True)
    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:104,代码来源:test_entry.py


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