All pastes #208343 Raw Edit

Stuff

public text v1 · immutable
#208343 ·published 2006-10-18 15:33 UTC
rendered paste body
if __name__ == '__main__':  
    from pgm import render
    from pgm.layout import window, fixed
    from pgm.form import rectangle, image
    import sys
    
    try:
        from twisted.internet import glib2reactor
        glib2reactor.install()
    except AssertionError:
        # already installed...
        pass
    
    from twisted.internet import reactor, task
    from twisted.spread import pb
    
    def refresh():
        win.dispatch_events()
    
    def exit_event_cb(event):    
        win.quit_loop()
        reactor.stop()
                    
    render.init('opengl1')
    title = 'widget_level test'
    win = window.Window(title=title)
    
    win.start_loop()
    
    f = fixed.Fixed()
    #wi = WidgetItem('/home/yoyo/eclipse_workspace/elisa/core/plugins/skins/default/pictures/pictures.png')
    wi = fixed.Fixed()
    mw = rectangle.Rectangle((180,180))
    wi.put(mw,(0,0))
    img = image.Image('/home/yoyo/eclipse_workspace/elisa/core/plugins/skins/default/pictures/pictures.png')
    mw.set_media(img)
    
    f.put(wi, (0,0) )
    win.add(f)
            
    _LoopingCall = task.LoopingCall( refresh )
    _LoopingCall.start( 1.0/60.0 )
    win.sig_exit_event.connect(exit_event_cb)
    reactor.run()