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


Python StandardWindow.resize方法代码示例

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


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

示例1: __init__

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [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

示例2: access_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [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

示例3: __init__

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

        """Build the titles for the table. The titles is a list of tuples with the following format:
        
        ( <String - Header Text>, <Bool - Sortable> )"""
        titles = []
        for i in range(COLUMNS):
            titles.append(
                    ("Column " + str(i), True if i != 2 else False)
                    )

        #Create our sorted list object
        slist = SortedList(win, titles=titles, size_hint_weight=EXPAND_BOTH,
            size_hint_align=FILL_BOTH)

        #Populate the rows in our table
        for i in range(ROWS):
            #Each row is a list with the number of elements that must equal the number of headers
            row = []
            for j in range(COLUMNS):
                #Row elements can be ANY elementary object
                if j == 0:
                    #For the first column in each row, we will create a button that will delete the row when pressed
                    btn = Button(slist, size_hint_weight=EXPAND_BOTH,
                                size_hint_align=FILL_BOTH)
                    btn.text = "Delete row"
                    btn.callback_clicked_add(
                        lambda x, y=row: slist.row_unpack(y, delete=True)
                        )
                    btn.show()
                    #Add the btn created to our row
                    row.append(btn)
                else:
                    #For each other row create a label with a random number
                    data = random.randint(0, ROWS*COLUMNS)
                    lb = Label(slist, size_hint_weight=EXPAND_BOTH,
                                size_hint_align=FILL_BOTH)
                    lb.text=str(data)
                    """For integer data we also need to assign value to "sort_data" because otherwise things get sorted as text"""
                    lb.data["sort_data"] = data
                    lb.show()
                    #Append our label to the row
                    row.append(lb)
            #Add the row into the SortedList
            slist.row_pack(row, sort=False)
        
        #Show the list
        slist.show()
        
        win.resize_object_add(slist)

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

示例4: __init__

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

        term = EmbeddedTerminal(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)

        term.show()

        win.resize_object_add(term)

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

示例5: genlist_clicked

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

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

    gl = Genlist(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    gl.callback_selected_add(_gl_selected, "arg1", "arg2",
        kwarg1="kwarg1", kwarg2="kwarg2")
    gl.callback_clicked_double_add(_gl_clicked_double, "arg1", "arg2",
        kwarg1="kwarg1", kwarg2="kwarg2")
    gl.callback_longpressed_add(_gl_longpressed, "arg1", "arg2",
        kwarg1="kwarg1", kwarg2="kwarg2")
    bx.pack_end(gl)
    gl.show()

    over = Rectangle(win.evas_get())
    over.color_set(0, 0, 0, 0)
    over.event_callback_add(evas.EVAS_CALLBACK_MOUSE_DOWN, _gl_over_click, gl)
    over.repeat_events_set(True)
    over.show()
    over.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
    win.resize_object_add(over)

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

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

    bt_50 = Button(win, text="Go to 50")
    vbx.pack_end(bt_50)
    bt_50.show()

    bt_1500 = Button(win, text="Go to 1500")
    vbx.pack_end(bt_1500)
    bt_1500.show()

    for i in range(0, 2000):
        gli = gl.item_append(itc1, i, func=gl_item_sel)
        if i == 50:
            bt_50._callback_add("clicked", lambda bt, it: it.bring_in(), gli)
        elif i == 1500:
            bt_1500._callback_add("clicked", lambda bt, it: it.bring_in(), gli)

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

示例6: __init__

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

        self.fs = fs = FileSelector(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        #fs.setMode("Open")
        fs.show()
        
        fs.callback_activated_add(self.showFile)
        fs.callback_cancel_add(lambda o: elm.exit())
        
        win.resize_object_add(fs)

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

示例7: __init__

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

        ourList = SearchableList(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.keys = ["Jeff", "Kristi", "Jacob", "Declan", "Joris", "Timmy", "Tristam"]
        for kbl in self.keys:
            ourList.item_append(kbl)
        ourList.show()

        win.resize_object_add(ourList)

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

示例8: start

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [as 别名]
def start():
    win = StandardWindow("Robot Eyes", "Eyes of the robot", autodel=True)
    win.callback_delete_request_add(lambda o: elementary.exit())

    face = Face(win)
    
    draw(win, face)
    def on_tick(*args, **kargs):
        draw(win, face)
        return True

    Animator(on_tick)

    win.resize(screenX, screenY)
    win.show()

    listener(face)
开发者ID:Hiwr,项目名称:hiwr_screen,代码行数:19,代码来源:screen.py

示例9: inner_window_clicked

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

    lb = Label(win)
    lb.text_set("This is an \"inwin\" - a window in a<br/>"
                "window. This is handy for quick popups<br/>"
                "you want centered, taking over the window<br/>"
                "until dismissed somehow. Unlike hovers they<br/>"
                "don't hover over their target.")

    iw = InnerWindow(win, content=lb)
    iw.show()

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

示例10: __init__

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [as 别名]
    def __init__( self ):
        win = StandardWindow("Testing", "Elementary About Dialog")
        win.callback_delete_request_add(lambda o: elm.exit())
        win.show()
        
        lbl = Label(win, size_hint_weight=EXPAND_BOTH,
            size_hint_align=FILL_BOTH)
        lbl.text = "This is a parent window for the About Dialog. Close when done."
        lbl.show()
        
        win.resize_object_add(lbl)

        win.resize(600, 400)
        win.show()
        
        AboutWindow(win, title="About Test", standardicon="dialog-information", \
                        version="1.0", authors=AUTHORS, \
                        licen=LICENSE, webaddress="https://github.com/JeffHoogland/python-elm-extensions", \
                        info=INFO)
开发者ID:JeffHoogland,项目名称:python-elm-extensions,代码行数:21,代码来源:test_aboutwindow.py

示例11: elm_input_events_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [as 别名]
def elm_input_events_clicked(obj, item=None):
    win = StandardWindow("inputevents", "Input Events Test", autodel=True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

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

    entry = Entry(win, scrollable=True, size_hint_align=FILL_BOTH,
        size_hint_weight=(1.0, 0.2))
    entry.text = (
        "This example will show how Elementary input events are handled. "
        "Typing in this entry will log in the entry box below all events "
        "caught by event handlers set to this Entry widget and its parent, "
        "the Window widget. Key up events are checked for in the callback "
        "and won't propagate to a parent widget."
        )
    entry.show()

    log_entry = Entry(win, editable=False, scrollable=True, focus_allow=False,
        size_hint_align=FILL_BOTH, size_hint_weight=(1.0, 0.8))
    log_entry.callback_changed_add(changed_cb)
    log_entry.show()

    btn = Button(win, text="Clear log", focus_allow=False)
    btn.callback_clicked_add(lambda x: setattr(log_entry, "entry", ""))
    btn.show()

    box.pack_end(entry)
    box.pack_end(log_entry)
    box.pack_end(btn)

    entry.elm_event_callback_add(events_cb, log_entry)
    entry.markup_filter_append(filter_cb)
    win.elm_event_callback_add(events_cb, log_entry)

    win.resize(640, 480)
    win.show()

    entry.focus = True
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:43,代码来源:test_input_events.py

示例12: __init__

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

        tabbs = TabbedBox(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        tabbs.closeCallback = self.closeChecks
        
        for i in range(10):
            lbl = Label(win)
            lbl.text = "Tab %s"%i
            lbl.show()
            tabbs.addTab(lbl, "Tab %s"%i)
        
        tabbs.disableTab(0)
        tabbs.disableTab(3)
        
        tabbs.show()
        
        win.resize_object_add(tabbs)

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

示例13: core_evas_objects_clicked

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

    rect = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
    rect.show()

    line = Line(win.evas, start=(20,40), end=(200,100), color=(255,0,0,255))
    line.show()

    text = Text(win.evas, text="Evas Text Object", size=(300, 30), color=(0,0,0,255))
    text.font_set("Sans", 16)
    text.pos = (40, 20)
    text.show()

    poly = Polygon(win.evas, color=(200, 0, 200, 200))
    poly.point_add(10,100)
    poly.point_add(100,120)
    poly.point_add(20,30)
    poly.show()

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

示例14: Application

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [as 别名]
class Application(object):
    def __init__(self):
        self.cfg = ConfigOption()
        self.userid = os.getuid()
        self.win = None
        self.bg = None
        self.main_box = None
        self.info_frame = None
        self.lb = None
        self.ps_list = None

        self.win = StandardWindow("my app", "eyekill", size=(320, 384))
        self.win.title_set("eye kill")
        self.win.callback_delete_request_add(self.destroy)

        self.main_box = Box(self.win)
        self.main_box.size_hint_weight = EXPAND_BOTH
        self.win.resize_object_add(self.main_box)
        self.main_box.show()

        self.info_frame = Frame(self.win)
        self.info_frame.text_set("Information")
        self.main_box.pack_end(self.info_frame)
        self.info_frame.show()

        self.lb = Label(self.win)
        self.lb.text_set('<b>Kill process with a double click</b>')
        self.info_frame.content_set(self.lb)
        self.lb.show()

        self.ps_list = List(self.win)
        self.ps_list.size_hint_weight = EXPAND_BOTH
        self.ps_list.size_hint_align = FILL_BOTH
        self.ps_list.callback_clicked_double_add(self.kill_bill)

        self.update_list()

        self.main_box.pack_end(self.ps_list)
        self.ps_list.go()
        self.ps_list.show()
    
        self.win.resize(320, 384)
        self.win.show()


    def destroy(self, obj):
        # FIXME: but here self.cfg.save()???
        elementary.exit()


    def update_list(self):

        if bool(self.cfg.get_desktop()):
            for de in self.cfg.get_desktop():
                ps = psutil.Process(get_pid_by_name(de))
                pl = ps.children()
                for p in pl:
                    if p.uids().real == self.userid:
                        if p.name not in self.cfg.get_process():
                            short_info = '%s / %s / %s' % (p.pid, p.name(), p.status())
                            self.ps_list.item_append(label = short_info, callback = self.update_info, p = p)
        else:
            pl = psutil.get_pid_list()
            for p in pl:
                p = psutil.Process(p)
                if p.uids().real == self.userid:
                    if p.name() not in self.cfg.get_process():
                        short_info = '%s / %s / %s' % (p.pid, p.name(), p.status())
                        self.ps_list.item_append(label = short_info, callback = self.update_info, p = p)


    def update_info(self,li , it, p):
        info = ("PID %i STAT %s TIME %s<br/>MEM %s CPU %s COMMAND %s" % \
               (p.pid,\
                p.status(),\
                p.get_cpu_times().user,\
                hbytes(p.get_memory_info().rss),\
                p.get_cpu_percent(interval=0),\
                p.name()))
        self.lb.text_set(info)


    def kill_bill(self, obj, cb_data):
        bill = cb_data.data_get()[1]['p'].pid
        print ("%s ... Gotcha" % bill)
        os.kill(bill, signal.SIGTERM)
        if (os.kill(bill, 0)):
            os.kill(bill, signal.SIGKILL)
        item = obj.selected_item_get()
        item.disabled_set(True)
开发者ID:wfx,项目名称:eyekill,代码行数:92,代码来源:eyekill.py

示例15: main_loop

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import resize [as 别名]
def main_loop():
    win = StandardWindow("WLX42 Eyes", "Eyes of the robot", autodel=True)
    win.callback_delete_request_add(lambda o: elementary.exit())

    bg = Rectangle(win.evas, size = screenSize, color=(0,0,100,255), pos=(0,0))
    #bg.clip = Rectangle(win.evas, size = screenSize, color=(0,0,100,255), pos=(0,100) )
    bg.show()

    underlay = Rectangle(win.evas, pos=global_offset, size = screenSize, color=(255,255,255,255))
    underlay.show()

    eyes = Image(win, size = screenSize, pos=global_offset, file=os.path.join(img_path, "oeil-1.png"))
    #overlay.clip = Image(win, size = screenSize, pos=(0,0), file=os.path.join(img_path, "mb.png"))
    #overlay.clip.show()
    eyes.clip = Rectangle(win.evas, size = screenSize, color=(0,0,100,255), pos=(0,0) )
    eyes.clip.show()
    eyes.show()

    mustache = Image(win, size=screenSize, pos=global_offset, file=os.path.join(img_path, "moustaches.png"))
    mustache.clip = Rectangle(win.evas, size = screenSize, color=(0,0,100,255), pos=(0,0) )
    mustache.clip.show()
    mustache.stack_above(eyes)
    mustache.show()

    bubble_pos = (0,100)
    bubble_size = (2*106, 2*159)

    bubble = Image(win, size = bubble_size, pos=bubble_pos, file=os.path.join(img_path, "bulle.png"))

    bubble.clip = Rectangle(win.evas, size = bubble_size, color=(255,255,255,200), pos=bubble_pos )
    bubble.clip.show()
    bubble.stack_above(eyes)
    bubble.show()

    bubble_text_pos=(bubble_pos[0]+10, bubble_pos[1]+10)
    bubble_text = Text(win.evas, text='', color=(255,255,255,255), pos=bubble_text_pos, size=(180,180))
    bubble_text.font_source = font_path
    bubble_text.font = "FontAwesome", 150
    bubble_text.style = EVAS_TEXT_STYLE_SOFT_SHADOW
    bubble_text.shadow_color = (64,64,64,127)
    bubble_text.stack_above(bubble)
    bubble_text.show()

#    bx = Box(win)
#    win.resize_object_add(bx)
#    bx.size_hint_weight = EXPAND_BOTH
#    bx.show()
#    lb.show()

#    lb = Label(win, text="Blah, Blah, Blah")
#    lb2 = Label(win, text="Tut, Tut, Tut!")
#    bb = Bubble(win, text = "Message 1", content = lb,
#        pos = ELM_BUBBLE_POS_TOP_LEFT, size_hint_weight = EXPAND_BOTH,
#        size_hint_align = FILL_BOTH)
#    bb.part_text_set("info", "Corner: top_left")
#    bb.part_content_set("icon", ic)
#    bx.pack_end(bb)
#    bb.show()

    eyeballs = Image(win, size = eyeballs_size, pos=eyeballs_pos, file=os.path.join(img_path, "retine_sim.png"))
    

    blink = Image(win, size = screenSize, pos = global_offset, file=os.path.join(img_path, "oeil-11.png"))
    blink.clip = eyes.clip;

    dead = Image(win, size = screenSize, pos = global_offset, file=os.path.join(img_path, "oeil-10.png"))

    #eyes
    eyeballs.stack_below(eyes)
    eyeballs.show()

    def on_tick(*args, **kargs):
        draw(win, bg, eyeballs, eyes, blink)
        return True

    Animator(on_tick)

    draw(win, bg, eyeballs, eyes, blink)

    win.resize(screenX, screenY)
    win.show()
开发者ID:Hiwr,项目名称:hiwr_screen,代码行数:83,代码来源:eyes.py


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