import gobject
import gtk

window = None
timeouts = [10, 20, 50, 100, 200, 500, 1000]
timeout_index = 0

def do_one():
    global window
    global timeout_index

    if window != None:
        window.destroy()

    window = gtk.Window()
    window.show()

    gobject.timeout_add(timeouts[timeout_index], do_one)
    timeout_index += 1
    if timeout_index == len(timeouts):
        timeout_index = 0

    return False

do_one()
gtk.main()
