#!/usr/bin/python import clutter class 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 = 5242880 units_to_device = 80 == 25 percent =========== units_from_stage_width_percentage = 13107200 units_to_device = 200 == 50 percent =========== units_from_stage_width_percentage = -16735272 units_to_device = -256 == 100 percent =========== units_from_stage_width_percentage = 9479127 units_to_device = 144