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


Python StandardWindow.resize_object_add方法代码示例

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


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

示例1: genlist3_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def genlist3_clicked(obj, item=None):
    win = StandardWindow("Genlist", "Genlist Group test", autodel=True,
        size=(320, 320))

    gl = Genlist(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(gl)
    gl.show()

    itc_i = GenlistItemClass(item_style="default",
                             text_get_func=gl_text_get,
                             content_get_func=gl_content_get,
                             state_get_func=gl_state_get)

    itc_g = GenlistItemClass(item_style="group_index",
                             text_get_func=glg_text_get,
                             content_get_func=glg_content_get)

    for i in range(300):
        if i % 10 == 0:
            git = gl.item_append(itc_g, i/10,
                                 flags=ELM_GENLIST_ITEM_GROUP)
            git.select_mode_set(ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
        gl.item_append(itc_i, i, git)

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

示例2: buttons_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def buttons_clicked(obj):
    win = StandardWindow("buttons", "Buttons", focus_highlight_enabled=True,
        autodel=True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    ic = Icon(win, file=ic_file,
        size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
    ic.show()
    bt = Button(win, text="Icon sized to button", content=ic)
    bx.pack_end(bt)
    bt.show()

    ic = Icon(win, file=ic_file, resizable=(False, False))
    ic.show()
    bt = Button(win, text="Icon no scale", content=ic)
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="No icon")
    bx.pack_end(bt)
    bt.show()

    ic = Icon(win, file=ic_file, resizable=(False, False))
    bt = Button(win, content=ic)
    bx.pack_end(bt)
    bt.show()
    ic.show()

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

示例3: __init__

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
    def __init__( self ):
        win = StandardWindow("Testing", "Elementary Sorted Table")
        win.callback_delete_request_add(lambda o: elm.exit())

        titles = []
        for i in range(COLUMNS):
            titles.append(
                    ("Column " + str(i), True if i != 2 else False)
                    )

        slist = SortedList(win, titles=titles, size_hint_weight=EXPAND_BOTH,
            size_hint_align=FILL_BOTH)

        for i in range(ROWS):
            row = []
            for j in range(COLUMNS):
                data = random.randint(0, ROWS*COLUMNS)
                row.append(data)
            slist.row_pack(row, sort=False)
        #slist.sort_by_column(1)
        slist.show()
        
        win.resize_object_add(slist)

        win.resize(600, 400)
        win.show()
开发者ID:JeffHoogland,项目名称:python-elm-extensions,代码行数:28,代码来源:test_sortedlist.py

示例4: clock_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def clock_clicked(obj):
    win = StandardWindow("clock", "Clock", autodel=True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    L = []

    ck = Clock(win)
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    ck = Clock(win, show_am_pm=True)
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    print((ck.time_get()))

    ck = Clock(win, show_seconds=True)
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    ck = Clock(win, show_seconds=True, show_am_pm=True)
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    ck = Clock(win, edit=True, show_seconds=True, show_am_pm=True,
        time=(10, 11, 12))
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    ck = Clock(
        win, edit=True, show_seconds=True, edit_mode = (
            ELM_CLOCK_EDIT_HOUR_DECIMAL |
            ELM_CLOCK_EDIT_MIN_DECIMAL |
            ELM_CLOCK_EDIT_SEC_DECIMAL
            )
        )
    bx.pack_end(ck)
    ck.show()
    L.append(ck)

    hbox = Box(win, horizontal=True)
    bx.pack_end(hbox)
    hbox.show()

    ck = Check(win, text="pause")
    ck.callback_changed_add(pause_changed_cb, L)
    ck.show()
    hbox.pack_end(ck)

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

示例5: layout_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def layout_clicked(obj):
    win = StandardWindow("layout", "Layout", autodel=True)
    win.elm_event_callback_add(_event)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    ly = Layout(win, file=(os.path.join(script_path, "test.edj"), "layout"),
        size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(ly)
    ly.show()

    bt = Button(win, text="Button 1")
    ly.part_content_set("element1", bt)
    bt.elm_event_callback_add(_event)
    bt.elm_event_callback_del(_event)
    bt.show()

    bt = Button(win, text="Button 2")
    ly.part_content_set("element2", bt)
    bt.show()

    bt = Button(win, text="Button 3")
    ly.part_content_set("element3", bt)
    bt.show()

    for o in ly.content_swallow_list_get():
        print("Swallowed: " + str(o))

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

示例6: evas_textgrid_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def evas_textgrid_clicked(obj, item=None):
    win = StandardWindow("evastextgrid", "Evas Textgrid Test", autodel=True,
        size=(320, 320))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    tg = Textgrid(win.evas)
    tg.size = 15, 1
    tg.size_hint_weight_set(1.0, 1.0)
    win.resize_object_add(tg)
    tg.font = "Courier", 20
    tg.palette_set(EVAS_TEXTGRID_PALETTE_STANDARD, 0, 0, 0, 0, 255)
    tg.palette_set(EVAS_TEXTGRID_PALETTE_STANDARD, 1, 255, 255, 255, 255)

    row = tg.cellrow_get(0)
    for cell in row:
        cell.codepoint="ö"
        cell.fg = 1
        cell.bg = 0
    tg.cellrow_set(0, row)

    tg.show()
    tg.update_add(0, 0, 10, 1)

    rowback = tg.cellrow_get(0)

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

示例7: photo_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def photo_clicked(obj):
    win = StandardWindow("photo", "Photo test", autodel=True, size=(300, 300))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    elementary.need_ethumb()

    tb = Table(win, size_hint_weight=EXPAND_BOTH)
    tb.show()

    sc = Scroller(win, size_hint_weight=EXPAND_BOTH, content=tb)
    win.resize_object_add(sc)
    sc.show()

    n = 0
    for j in range(12):
        for i in range(12):
            ph = Photo(win, aspect_fixed=False, size=80, editable=True,
                size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
            name = os.path.join(img_path, images[n])
            n += 1
            if n >= 9: n = 0
            if n == 8:
                ph.thumb = name
            else:
                ph.file = name
            if n in [2, 3]:
                ph.fill_inside = True
                ph.style = "shadow"

            tb.pack(ph, i, j, 1, 1)
            ph.show()

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

示例8: access_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def access_clicked(obj, item=None):
    win = StandardWindow("access", "Access")
    win.autodel = True
    win.on_free_add(cleanup_cb)

    config.access = True

    bx = Box(win, size_hint_weight=EXPAND_BOTH, homogeneous=True,
        horizontal=True)
    win.resize_object_add(bx)
    bx.show()

    gl = Genlist(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx.pack_end(gl)
    gl.show()

    gl.callback_realized_add(_realized)

    itc1 = GLItC1(item_style="default")
    itc2 = GLItC2(item_style="full")

    for i in range(1,9):
        if i % 4:
            gl.item_append(itc1, i, None, ELM_GENLIST_ITEM_NONE)
        else:
            gl.item_append(itc2, i, None, ELM_GENLIST_ITEM_NONE)

    itc1.free()
    itc2.free()
    win.resize(500, 400)
    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:33,代码来源:test_access.py

示例9: index_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def index_clicked(obj):
    win = StandardWindow("index", "Index test", autodel=True, size=(320, 480))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    vbox = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(vbox)
    vbox.show()

    # index
    idx = Index(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
    idx.callback_delay_changed_add(cb_idx_delay_changed)
    idx.callback_changed_add(cb_idx_changed)
    idx.callback_selected_add(cb_idx_selected)
    win.resize_object_add(idx)
    idx.show()

    # genlist
    itc = GenlistItemClass(item_style="default",
                           text_get_func=gl_text_get)
                           # content_get_func=gl_content_get,
                           # state_get_func=gl_state_get)
    gl = Genlist(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(gl)
    gl.show()


    for i in 'ABCDEFGHILMNOPQRSTUVZ':
        for j in 'acegikmo':
            gl_item = gl.item_append(itc, i + j)
            if j == 'a':
                idx_item = idx.item_append(i, cb_idx_item, gl_item)
                idx_item.data["gl_item"] = gl_item

    idx.level_go(0)

    sep = Separator(win, horizontal=True)
    vbox.pack_end(sep)
    sep.show()

    hbox = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ)
    vbox.pack_end(hbox)
    hbox.show()

    ck = Check(win, text="autohide_disabled")
    ck.callback_changed_add(lambda ck: idx.autohide_disabled_set(ck.state))
    hbox.pack_end(ck)
    ck.show()

    ck = Check(win, text="indicator_disabled")
    ck.callback_changed_add(lambda ck: idx.indicator_disabled_set(ck.state))
    hbox.pack_end(ck)
    ck.show()

    ck = Check(win, text="horizontal")
    ck.callback_changed_add(lambda ck: idx.horizontal_set(ck.state))
    hbox.pack_end(ck)
    ck.show()

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

示例10: panes_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def panes_clicked(obj):
    win = StandardWindow("panes", "Panes test", autodel=True, size=(320, 480))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    panes = Panes(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    win.resize_object_add(panes)
    panes.callback_clicked_add(cb_panes, "clicked")
    panes.callback_clicked_double_add(cb_panes, "clicked,double")
    panes.callback_press_add(cb_panes, "press")
    panes.callback_unpress_add(cb_panes, "unpress")
    panes.show()

    bt = Button(win, text="Left")
    panes.part_content_set("left", bt)
    bt.show()

    panes_h = Panes(win, horizontal=True, size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    panes_h.horizontal = True
    panes.part_content_set("right", panes_h)
    panes_h.show()

    bt = Button(win, text="Up")
    panes_h.part_content_set("left", bt)
    bt.show()

    bt = Button(win, text="Down")
    panes_h.part_content_set("right", bt)
    bt.show()

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

示例11: table5_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def table5_clicked(obj, item=None):
    win = StandardWindow("table5", "Table 5", autodel=True)

    tb = Table(win, homogeneous=True, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(tb)
    tb.show()

    bt = Button(win, text="A", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 33, 0, 34, 33)
    bt.show()

    bt = Button(win, text="B", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 67, 33, 33, 34)
    bt.show()

    bt = Button(win, text="C", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 33, 67, 34, 33)
    bt.show()

    bt = Button(win, text="D", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 0, 33, 33, 34)
    bt.show()

    bt = Button(win, text="X", size_hint_weight=EXPAND_BOTH,
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 33, 33, 34, 34)
    bt.show()

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

示例12: table4_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def table4_clicked(obj, item=None):
    win = StandardWindow("table4", "Table 4", autodel=True)

    tb = Table(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(tb)
    win.data["tb"] = tb
    tb.show()

    bt = Button(win, text="Button 1", size_hint_weight=(0.25, 0.25),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 0, 0, 1, 1)
    win.data["b1"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

    bt = Button(win, text="Button 2", size_hint_weight=(0.75, 0.25),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 1, 0, 1, 1)
    win.data["b2"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

    bt = Button(win, text="Button 3", size_hint_weight=(0.25, 0.75),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 0, 1, 1, 1)
    win.data["b3"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

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

示例13: dnd_genlist_user_anim_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def dnd_genlist_user_anim_clicked(obj, item=None):
    win = StandardWindow("dnd-genlist-user-anim", "DnD-Genlist-User-Anim",
        autodel=True, size=(680,800))

    bxx = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bxx)
    bxx.show()

    for j in range(2):
        gl = Genlist(win, multi_select=True, size_hint_weight=EXPAND_BOTH,
            size_hint_align=FILL_BOTH)

        # START Drag and Drop handling
        win.callback_delete_request_add(win_del, gl)
        gl.drop_item_container_add(ELM_SEL_FORMAT_TARGETS, gl_item_getcb,
            dropcb=gl_dropcb)

        gl.drag_item_container_add(ANIM_TIME, DRAG_TIMEOUT, gl_item_getcb,
            gl_data_getcb)

        # We add mouse-down, up callbacks to start/stop drag animation
        gl.event_callback_add(EVAS_CALLBACK_MOUSE_DOWN, gl_obj_mouse_down, gl)
        # END Drag and Drop handling

        # FIXME: This causes genlist to resize the horiz axis very slowly :(
        # Reenable this and resize the window horizontally, then try to resize it back
        #elm_genlist_mode_set(gl, ELM_LIST_LIMIT)
        bxx.pack_end(gl)
        gl.show()

        for i in range(20):
            gl.item_append(itc1, img[i % 9], flags=ELM_GENLIST_ITEM_NONE)

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

示例14: focus3_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def focus3_clicked(obj, item=None):
    win = StandardWindow("focus3", "Focus 3", autodel=True, size=(320, 480))

    win.focus_highlight_enabled = True

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    en = Entry(win, scrollable=True, single_line=True, text="An entry",
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    en.callback_focused_add(_focused_cb)
    en.callback_unfocused_add(_unfocused_cb)
    bx.pack_end(en)
    en.show()

    bt = Button(win, text="Add", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_add_cb, win, bx)
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="Del", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_del_cb, bx)
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="hide", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_hide_cb)
    bx.pack_end(bt)
    bt.show()

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

示例15: transit_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize_object_add [as 别名]
def transit_clicked(obj, item=None):
    win = StandardWindow("transit", "Transit")
    win.autodel = True

    bx = Box(win)
    bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
    win.resize_object_add(bx)
    bx.size_hint_min = 318, 318
    bx.show()

    ic = Image(win, file=os.path.join(img_path, "icon_11.png"),
        size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))

    bt = Button(win, text="ImageAnimation Effect")
    bt.part_content_set("icon", ic)
    bx.pack_end(bt)
    bt.show()
    ic.show()
    bt.callback_clicked_add(transit_image_animation, ic)

    bt = Button(win, text="Color, Rotation and Translation")
    bx.pack_end(bt)
    bt.show()
    bt.callback_clicked_add(transit_rotation_translation_color)

    bt = Button(win, text="Wipe Effect")
    bx.pack_end(bt)
    bt.show()
    bt.callback_clicked_add(transit_wipe)

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


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