Exemplo n.º 1
0
def main():
    with pygame_display((800, 600)) as display:
        v = VBox(List([
            TextEdit(lambda : 'Moshiko!'),
            TextEdit(lambda : 'Dani!'),
            TextEdit(lambda : 'Yosefa!'),
            TextEdit(lambda : 'Yekutiel!'),
        ]))
        from gui.loop import loop
        loop.loop(display.subsurface(10,10,500,500), v)
Exemplo n.º 2
0
    from cProfile import Profile
    p = Profile() #clock)
    print "Profiling to", profile_filename
    p.runcall(func, *args, **kw)

    from pytools import lsprofcalltree
    k = lsprofcalltree.KCacheGrind(p)
    pdump_filename = profile_filename+'.pstats'
    p.dump_stats(pdump_filename)
    print "Profile dumped to", pdump_filename
    kcache_grind_filename = profile_filename+'.kcachegrind'
    with open(kcache_grind_filename, 'w+b') as f:
        k.output(f)
    print "Profile results written to", kcache_grind_filename

with pygame_display((1024, 768), pygame.DOUBLEBUF) as display:
    from codegui.loop import loop
    from codegui.BrowserWidget import BrowserWidget

    from codegui.Namer import Namer
    from codegui.widget_for import NormalWidgetMaker
    loop.namer = Namer()
    
    from example import example
    loop.browser = BrowserWidget(NormalWidgetMaker.make(example))

    import pygame
    pygame.key.set_repeat(250,10)

    loop.loop(display, loop.browser)
#    profile_call(loop.loop, display, loop.browser)
Exemplo n.º 3
0
# Copyright (c) 2007 Enough Project.
# See LICENSE for details.

from __future__ import with_statement

import pygame
import contextlib
from gui import draw
from gui.main import pygame_display

from lib.graph import Node, Edge

res = (800, 600)
with pygame_display(res, pygame.DOUBLEBUF) as display:
    from loop import loop
    from GraphWidget import GraphWidget
    from BrowserWidget import BrowserWidget
    loop.browser = BrowserWidget(GraphWidget((800,400)))
    
    import pygame
    pygame.key.set_repeat(250,10)

    loop.loop(display, loop.browser)