1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygtk
import gtk
class affich:
def destroy(widget, data=None):
gtk.main_quit()
def __init__(self):
# Creation fenetre
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("NTest")
self.window.set_border_width(10)
self.window.connect("destroy", self.destroy)
label = gtk.Label("Texte 00000")
while gtk.events_pending():
gtk.main_iteration()
self.window.add(label)
label.show()
self.window.show()
while gtk.events_pending():
gtk.main_iteration()
label.set_text("Texte 1111111")
while gtk.events_pending():
gtk.main_iteration()
count = 0
while (count < 10000000):
count = count + 1
label.set_text("Texte 22222222")
while gtk.events_pending():
gtk.main_iteration()
count = 0
while (count < 10000000):
count = count + 1
label.set_text("Texte 33333333")
def main(self):
gtk.main()
if __name__ == "__main__":
aff = affich()
aff.main() |