All pastes #931059 Raw Edit

Anonymous

public python v1 · immutable
·published 2008-03-06 22:58 UTC
rendered paste body
#!/usr/bin/pythonimport clutterclass Main:    def __init__(self):        self.stage = clutter.Stage()        self.stage.set_size(800, 600)        self.stage.connect('key-press-event', clutter.main_quit)        print "==== stage_size = %ix%i\n" % (self.stage.get_size())        for percent in [10,25,50,100]:            print "== %i percent ===========" % (percent)                        temp = clutter.units_from_stage_width_percentage(percent)            print "units_from_stage_width_percentage = ", temp                        temp = clutter.units_to_device(temp)            print "units_to_device  = %i \n" % (temp)                    self.stage.show_all()            def run(self):        clutter.main()    if __name__ == "__main__":    main = Main()    main.run()== OUTPUT ===================================================== stage_size = 800x600== 10 percent ===========units_from_stage_width_percentage =  5242880units_to_device  = 80 == 25 percent ===========units_from_stage_width_percentage =  13107200units_to_device  = 200 == 50 percent ===========units_from_stage_width_percentage =  -16735272units_to_device  = -256 == 100 percent ===========units_from_stage_width_percentage =  9479127units_to_device  = 144